- 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.txtfiles included here into your directory. - In a command line,
cdto your project folder. docker-compose builddocker-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_urlLink to example config docker-compose run web ./manage.py migratedocker-compose run web ./manage.py createsuperuserdocker-compose upand 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
dashboardto hold your custom wagtail branding templates. This is done withdocker-compose run web django startapp dashboard - Copy the
dashboard/templatesfolder 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_APPSinbase.pymaking 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
migrateandcreatesuperusercommands 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)