Deploy your Wagtail site on Netlify. Features include:
- automatic deployment when pages are published
- a new
netlifymanagement command - conversion of Wagtail redirects to Netlify's format
- Install and configure Wagtail Bakery, if you haven't already
- Install Netlify, if you haven't already
pip install git+https://github.com/tomdyson/wagtail-netlify.git
- Add
'wagtailnetlify'to yourINSTALLED_APPS - Run the migrations:
./manage.py migrate wagtailnetlify - Add
NETLIFY_PATHto your settings (hint: typewhich netlifyto check the location)
- If you are deploying to an existing Netlify site, provide its ID with
NETLIFY_SITE_ID = 'your-id-here' - If you don't want Wagtail to deploy your site to Netlify every time you publish a page, set
NETLIFY_AUTO_DEPLOY = False - If you don't want to or are unable to click the Netlify authentication link in the console, generate a token manually and set
NETLIFY_API_TOKEN = 'your-token-here'in your settings. Warning: You should never check credentials in your version control system. Use environment variables or local settings file instead.
- If you haven't set
NETLIFY_AUTO_DEPLOY = False, Wagtail will automatically deploy your site every time a page is published. This make take between a few seconds and a few minutes, depending on the size of your site, and the number of pages which are affected by your change. - To deploy changes manually, use
./manage.py netlify
Netlify can send a webhook after a successful deployment. This app provides an endpoint for that webhook and an admin view of
completed deployments. To enable this view, add 'wagtail.contrib.modeladmin' to your INSTALLED_APPS and update your project's urls.py:
# in your imports
from wagtailnetlify import views as netlify_views
# in urlpatterns, before including wagtail_urls
url(r'^netlify/', netlify_views.success_hook, name='netlify'),In Netlify's admin interface for your app, add http://yourdomain/netlify/success as a URL to notify for the outgoing webhook on 'Deploy succeeded' events (in Settings / Build & deploy / Deploy notifications).
- Provide an admin view for reporting on deployments
- Allow adminstrators to trigger deploys manually
- Allow developers to replace
Threadingwith Celery or similar, for more robust async behaviour. - Tests
