Skip to main content

Deploy Wagtail sites to Netlify

Project description

wagtail-netlify

Deploy your Wagtail site on Netlify. Features include:

  • automatic deployment when pages are published
  • a new netlify management command
  • conversion of Wagtail redirects to Netlify's format

Screencast demo

Install

  1. Install and configure Wagtail Bakery, if you haven't already
  2. Install Netlify, if you haven't already
  3. Install the project with pip install wagtailnetlify.

Configure

Mandatory

  1. Add 'wagtailnetlify' to your INSTALLED_APPS
  2. Run the migrations: ./manage.py migrate wagtailnetlify
  3. Add NETLIFY_PATH to your settings (hint: type which netlify to check the location)

Optional

  • 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.

Usage

  1. 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.
  2. To deploy changes manually, use ./manage.py netlify

Optional admin view

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).

Development

Releases

  1. Ensure you have the latest versions of pip, setuptools and twine installed in your virtual environment.
  2. Create a new branch (e.g. release/v1.1.3) for the release of the new version.
  3. Update the version number in wagtailnetlify/__init__.py following Semantic Versioning.
  4. Update CHANGELOG.md.
  5. On GitHub, create a pull request and squash merge it.
  6. Checkout and pull the master branch locally.
  7. (Optional) If you need to verify anything, use make publish-test to upload to https://test.pypi.org and enter your PyPi test credentials as needed.
  8. Use make publish and enter your PyPi credentials as needed.
  9. On GitHub, create a release and a tag for the new version.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtailnetlify-0.1.tar.gz (6.4 kB view details)

Uploaded Source

File details

Details for the file wagtailnetlify-0.1.tar.gz.

File metadata

  • Download URL: wagtailnetlify-0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for wagtailnetlify-0.1.tar.gz
Algorithm Hash digest
SHA256 572cdd403200aff2d6267939c29c12b5a1072a1abd15569514fd05ee34e8a49a
MD5 a155cf1562b2be84c91ac487f175ed46
BLAKE2b-256 aadbabd7dc280a4fb74e4a84086a6686c46d2e61bfc087cb3e86d60bea2bfcf1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page