- Go to folder you want to start a new project in. It doesn't have to be empty.
- Copy the
.dockerfile
,docker-compose.yml
, andrequirements.txt
files included here into your directory. - In a command line,
cd
to your project folder. docker-compose build
docker-compose run web wagtail start [projectname]
- Move the contents of the new [projectname] folder out into the root
- Change the database settings in [projectname]/settings/base.py to use
dj_database_url
Link to example config docker-compose run web ./manage.py migrate
docker-compose run web ./manage.py createsuperuser
docker-compose up
and your Wagtail admin will be running athttp://localhost/admin
(if you use the default docker ip)
Update your STATICFILES_DIRS
, STATIC_ROOT
, STATIC_URL
, MEDIA_ROOT
, MEDIA_URL
variables.
- Create a new app called
dashboard
to hold your custom wagtail branding templates. This is done withdocker-compose run web django startapp dashboard
- Copy the
dashboard/templates
folder from this repo into your own dashboard folder. - Point the image sources in these tempates to a logo and change
[project name]
to a suitable name. - Add
'dashboard'
to theINSTALLED_APPS
inbase.py
making sure'overextends','dashboard',
comes before'wagtail.wagtailadmin','wagtail.wagtailcore',
.
Required files:
- Procfile (requires pointing to the correct wsgi file)
- runtime.txt (requires setting to correct env)
- wsgi.py changes Link to config
- Add the dokku server to your remotes.
git remote add dokku dokku@server.com:[appname]
- Push to dokku.
git push dokku [currentbranch]:master
- Either import a database with pgAdmin or run the
migrate
andcreatesuperuser
commands details above
import dj_database_url
DATABASES = {
'default': dj_database_url.config()
}
Replace with the following:
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "[APPNAME].settings")
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
application = get_wsgi_application()
application = DjangoWhiteNoise(application)