Coder Social home page Coder Social logo

bakerydemo-docker-prod's Introduction

Wagtail-based template for blog app.

This project is based on the amazing Wagtail CMS.

This project is set up to be test-deployed with github-Actions CI/CD

Run into docker containers: wagtail + uwsgi >> nginx >> postgres >> redis >> elasticsearch >> traefik+SSL

Setup with Docker

Dependencies

Installation

Run the following commands to test project locally with traefik and nginx:

git clone https://github.com/wagtail/bakerydemo-docker-prod.git
cd bakerydemo
docker-compose -f docker-compose.local.traefik.nginx.yml up --build
docker-compose run app /venv/bin/python manage.py load_initial_data
docker-compose up

The demo site will now be accessible at http://localhost:80/ and the Wagtail admin interface at http://localhost:80/admin/.

Log into the admin with the credentials admin / changeme.

Important: This docker-compose.local.traefik.nginx.yml is configured for local testing only, and is not intended for production use.

Setup with Virtualenv

You can run the Wagtail demo locally without setting up Vagrant or Docker and simply use Virtualenv, which is the recommended installation approach for Django itself.

Dependencies

Installation

With PIP and virtualenvwrapper installed, run:

mkvirtualenv wagtailbakerydemo
python --version

Confirm that this is showing a compatible version of Python 3.x. If not, and you have multiple versions of Python installed on your system, you may need to specify the appropriate version when creating the virtualenv:

deactivate
rmvirtualenv wagtailbakerydemo
mkvirtualenv wagtailbakerydemo --python=python3.6
python --version

Now we're ready to set up the bakery demo project itself:

cd ~/dev [or your preferred dev directory]
git clone https://github.com/wagtail/bakerydemo.git
cd bakerydemo
pip install -r requirements/base.txt

Next, we'll set up our local environment variables. We use django-dotenv to help with this. It reads environment variables located in a file name .env in the top level directory of the project. The only variable we need to start is DJANGO_SETTINGS_MODULE:

$ cp bakerydemo/settings/local.py.example bakerydemo/settings/local.py
$ echo "DJANGO_SETTINGS_MODULE=bakerydemo.settings.local" > .env

To set up your database and load initial data, run the following commands:

./manage.py migrate
./manage.py load_initial_data
./manage.py runserver

Log into the admin with the credentials admin / changeme.

Sending email from the contact form

The following setting in base.py and production.py ensures that live email is not sent by the demo contact form.

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

In production on your own site, you'll need to change this to:

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

and configure SMTP settings appropriate for your email provider.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.