Package: wagtailnetlify
wagtail-netlifyDeploy your Wagtail site on Netlify. Features include:automatic deployment when pages are publisheda newnetlifymanagement commandconversion of Wagtail redirects to Netlify's formatInstallationInstall and configureWagtail Bakery, if you haven't already.InstallNetlify CLI v2.x, if you haven't already.Install Wagtail-Netlify via pip (withpip install wagtailnetlify).ConfigurationAddwagtailnetlifyto yourINSTALLED_APPS.Run the migrations:./manage.py migrate wagtailnetlify.AddNETLIFY_PATHorNETLIFY_BUILD_HOOKto your settings.Check theSettingssection below for more customisation options.UsageIfNETLIFY_AUTO_DEPLOYis set toTrue, Wagtail will automatically deploy your site every time a page is published.orTo deploy changes manually, use./manage.py netlify.To generate redirects without deploying, use the-nor--no-deployflag:./manage.py netlify --no-deploy.To trigger a build on Netlify's servers, configuresettings.NETLIFY_BUILD_HOOKand use the-tor--trigger-buildflag:./manage.py netlify --trigger-build.SettingsNETLIFY_PATHThe path to the Netlify CLI.Hint: typewhich netlifyto check the location.NETLIFY_SITE_IDDefault:NoneIf set, deploy to that specific Netlify site.If not set, the Netlify CLI might prompt you to select one.NETLIFY_API_TOKENDefault:NoneIf set, the Netlify CLI will not prompt you to click the authentication link in the console. It can be useful when deployed to a remote server where you don't see the console output.Connect to your Netlify account togenerate a tokenand then set the settings.Warning: You should never check credentials in your version control system. Useenvironment variablesorlocal settings fileinstead.NETLIFY_AUTO_DEPLOYDefault:FalseWhether to automatically deploy your site to Netlify every time you publish a page. 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. If you have configuredsettings.NETLIFY_BUILD_HOOK, publishing a page will trigger a build on Netlify's servers.NETLIFY_DEPLOY_FUNCTIONDefault:wagtailnetlify.models.deployThe function to be called when a deploy is triggered (excluding when triggered manually with the./manage.py netlifycommand). It can be useful if you want to use your own task runner (like Celery) instead of the built-in threading model.The function needs to be a validDjango signal receiver.NETLIFY_BUILD_HOOKDefault:NoneThe URL of a Netlify build hook. If provided,./manage.py netlify --trigger-buildwill call this hook, triggering a build
on Netlify's servers. This may be useful if you have a headless front-end on Netlify which handles its own static site generation,
e.g. Nuxt, Next or Gatsby. Seehttps://docs.netlify.com/configure-builds/build-hooks/for more details.Optional admin view and endpointsNetlify 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:Addwagtail.contrib.modeladminto yourINSTALLED_APPSUpdate your project'surls.py:# in your importsfromwagtailnetlifyimporturlsasnetlify_urls# in urlpatterns, before including wagtail_urlsurl(r"^netlify/",include(netlify_urls)),In Netlify's admin interface for your app, addhttp://yourdomain/netlify/successas a URL to notify for the outgoing webhook onDeploy succeededevents (in Settings / Build & deploy / Deploy notifications).The view will be available underSettings / Deploymentsin your site's admin.Including thewagtailnetlifyURLs will also enable a view at /netlify/redirects, which outputs any Wagtail redirects inNetlify's plain text format. This may be useful if you are using Netlify to host a headless front-end for your Wagtail site.DevelopmentReleasesEnsure you have the latest versions ofpip,setuptoolsandtwineinstalled in your virtual environment.Ensure yourmasterbranch is up to date.Create a new branch (e.g.release/v1.1.3) for the release of the new version.Update the version number inwagtailnetlify/__init__.pyfollowingSemantic Versioning.UpdateCHANGELOG.md.(Optional) If you need to verify anything, usemake publish-testto upload tohttps://test.pypi.organd enter your PyPitestcredentials as needed.On GitHub, create a pull request and squash merge it.Checkout and pull themasterbranch locally.Usemake publishand enter your PyPi credentials as needed.On GitHub, create a release and a tag for the new version.