Deployment to Aldryn Cloud¶
Wagtail is now supported on Aldryn Cloud. The following steps will guide you to deploy Wagtail Cookiecutter Foundation projects on Aldryn Cloud.
Steps to Deploy¶
Create a Wagtail project (like
wagtail-aldryn) on Aldryn using the guide - Get Started with Wagtail on AldrynCreate a local development environment of project generated.
Suppose the project you want to deploy (generated with Wagtail Cookiecutter Foundation) is named as
wagtail-demo.Now we can copy the apps directories from
wagtail-demoproject directory towagtail-aldrynproject directory. You can move apps likepages,blog,utilsetc. You are free to move any app but remember all static assets are present inpagesapp.Copy the
mediadirectory towagtail-aldrynproject directory.Open
requirements.infile fromwagtail-aldrynproject. Add the following requirements:wagtailfontawesome==1.0.5 celery==3.1.23 django-cachalot==1.2.1 django-compressor==2.1 django-environ==0.4.0 django-foundation-formtags==0.0.6 django-wagtail-feeds==0.0.3 django-libsass==0.7 django-redis==4.4.4 elasticsearch==2.4.0 libsass==0.11.1
For updated list, copy the requirements from your wagtail-demo project.
Open
settings.pyfile fromwagtail-aldrynproject. Add the following:INSTALLED_APPS.extend([ # add your project specific apps here 'compressor', 'foundation_formtags', 'wagtail_feeds', 'utils', 'pages', 'blog', 'events', 'contact', 'people', 'photo_gallery', 'products', 'documents_gallery', ]) COMPRESS_PRECOMPILERS = ( ('text/x-scss', 'django_libsass.SassCompiler'), )
Importing Database from
wagtail-demoproject.
Create db dump of
wagtail-demoproject.Wagtail Cookiecutter Foundation and Aldryn projects use PostgreSQL as a database management system (DBMS). To transfer your existing Postgres data dumps into the
wagtail-aldrynproject, the commands to do so could look like following example:docker exec <container_id> dropdb -U postgres db --if-exists docker exec <container_id> createdb -U postgres db docker exec <container_id> psql -U postgres --dbname=db -c "CREATE EXTENSION IF NOT EXISTS hstore" docker run --rm -v /path/to/dump:/app/tmp/db_dump --link <container_id>:postgres postgres:9.4 /bin/bash -c pg_restore -h postgres -U postgres -F /app/tmp/db_dump --dbname=db -n public --no-owner --exit-on-error
Note: <container_id> is usually something like: projectslug_db (if you’re unsure, open the docker-compose.yaml file and check.
- Test locally if everything works.
- Push changes to Server
To push code changes to the test server, run for example:
git add .
git commit -m "Your commit message"
git push
To push DB changes, run:
aldryn project push db
To push media file changes, run:
aldryn project push media
To deploy the test server, run:
aldryn project deploy
Useful links: