diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0d0c595003..c50d462411 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Changelog ~~~~~~~~~~~~~~~~~ * Dropped Django 1.9 and Python 3.3 support; note that Django 1.8.x is still supported + * Dropped support for generating static sites using django-medusa * Use minified versions of jQuery and jQuery UI in the admin. Total savings without compression 371 KB (Tom Dyson) * Hooks can now specify the order in which they are run (Gagaro) * Added a `submit_buttons` block to login template (Gagaro) diff --git a/README.rst b/README.rst index e504e7d955..c2e250614e 100644 --- a/README.rst +++ b/README.rst @@ -31,7 +31,6 @@ Features * Workflow support * An extensible `form builder `_ * Multi-site and multi-language support -* Optional `static site generation `_ * Excellent `test coverage `_ Find out more at `wagtail.io `_. diff --git a/docs/reference/contrib/index.rst b/docs/reference/contrib/index.rst index 840f1409ef..bac4346839 100644 --- a/docs/reference/contrib/index.rst +++ b/docs/reference/contrib/index.rst @@ -9,7 +9,6 @@ Wagtail ships with a variety of extra optional modules. settings forms/index - staticsitegen sitemaps frontendcache routablepage @@ -31,12 +30,6 @@ Site-wide settings that are editable by administrators in the Wagtail admin. Allows forms to be created by admins and provides an interface for browsing form submissions. -:doc:`staticsitegen` --------------------- - -Provides a management command that turns a Wagtail site into a set of static HTML files. - - :doc:`sitemaps` --------------- diff --git a/docs/reference/contrib/staticsitegen.rst b/docs/reference/contrib/staticsitegen.rst deleted file mode 100644 index d764f85b13..0000000000 --- a/docs/reference/contrib/staticsitegen.rst +++ /dev/null @@ -1,113 +0,0 @@ -Static site generator -===================== - -.. warning:: - - django-medusa is no longer maintained, and is incompatible with Django 1.8 and above; the information below is retained for historical reference only. An alternative module based on the `django-bakery`_ package is available as a third-party contribution: https://github.com/mhnbcu/wagtailbakery - -This document describes how to render your Wagtail site into static HTML files on your local file system, Amazon S3 or Google App Engine, using `django medusa`_ and the ``wagtail.contrib.wagtailmedusa`` module. - -Installing ``django-medusa`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -First, install ``django-medusa`` and ``django-sendfile`` from pip: - -.. code-block:: console - - $ pip install django-medusa django-sendfile - -Then add ``django_medusa`` and ``wagtail.contrib.wagtailmedusa`` to ``INSTALLED_APPS``: - -.. code-block:: python - - INSTALLED_APPS = [ - ... - 'django_medusa', - 'wagtail.contrib.wagtailmedusa', - ] - -Define ``MEDUSA_RENDERER_CLASS``, ``MEDUSA_DEPLOY_DIR`` and ``SENDFILE_BACKEND`` in settings: - -.. code-block:: python - - MEDUSA_RENDERER_CLASS = 'django_medusa.renderers.DiskStaticSiteRenderer' - MEDUSA_DEPLOY_DIR = os.path.join(BASE_DIR, 'build') - SENDFILE_BACKEND = 'sendfile.backends.simple' - - -Rendering -~~~~~~~~~ - -To render a site, run ``./manage.py staticsitegen``. This will render the entire website and place the HTML in a folder called ``medusa_output``. The static and media folders need to be copied into this folder manually after the rendering is complete. This feature inherits ``django-medusa``'s ability to render your static site to Amazon S3 or Google App Engine; see the `medusa docs `_ for configuration details. - -To test, open the ``medusa_output`` folder in a terminal and run ``python -m SimpleHTTPServer`` or ``python3 -m http.server`` respectively. - - -Advanced topics -~~~~~~~~~~~~~~~ - -GET parameters --------------- - -Pages which require GET parameters (e.g. for pagination) don't generate a suitable file name for the generated HTML files. - -Wagtail provides a mixin (``wagtail.contrib.wagtailroutablepage.models.RoutablePageMixin``) which allows you to embed a Django URL configuration into a page. This allows you to give the subpages a URL like ``/page/1/`` which work well with static site generation. - - -Example: - -.. code-block:: python - - from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin, route - - - class BlogIndex(Page, RoutablePageMixin): - ... - - @route(r'^$', name='main') - @route(r'^page/(?P\d+)/$', name='page') - def serve_page(self, request, page=1): - ... - -Then in the template, you can use the ``{% routablepageurl %}`` tag to link between the pages: - -.. code-block:: html+django - - {% load wagtailroutablepage_tags %} - - {% if results.has_previous %} - Previous page - {% else %} - - {% if results.has_next %} - Next page - {% else %} - - -Next, you have to tell the ``wagtailmedusa`` module about your custom routing... - - -Rendering pages which use custom routing ----------------------------------------- - -For page types that override the ``route`` method, we need to let ``django-medusa`` know which URLs it responds on. This is done by overriding the ``get_static_site_paths`` method to make it yield one string per URL path. - -For example, the BlogIndex above would need to yield one URL for each page of results: - -.. code-block:: python - - def get_static_site_paths(self): - # Get page count - page_count = ... - - # Yield a path for each page - for page in range(page_count): - yield '/%d/' % (page + 1) - - # Yield from superclass - for path in super(BlogIndex, self).get_static_site_paths(): - yield path - - -.. _django medusa: https://github.com/mtigas/django-medusa -.. _django-bakery: https://github.com/datadesk/django-bakery diff --git a/docs/releases/1.10.rst b/docs/releases/1.10.rst index 75e65ffd1d..f68aeb7d28 100644 --- a/docs/releases/1.10.rst +++ b/docs/releases/1.10.rst @@ -56,6 +56,12 @@ Django 1.9 and Python 3.3 support dropped Support for Django 1.9 and Python 3.3 has been dropped in this release; please upgrade from these before upgrading Wagtail. Note that the Django 1.8 release series is still supported, as a Long Term Support release. +Dropped support for generating static sites using ``django-medusa`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Django-medusa is no longer maintained, and is incompatible with Django 1.8 and above. An alternative module based on the `django-bakery`_ package is available as a third-party contribution: https://github.com/moorinteractive/wagtail-bakery. + + Signals on custom ``Image`` and ``Rendition`` models connected automatically ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/wagtail/contrib/wagtailmedusa/__init__.py b/wagtail/contrib/wagtailmedusa/__init__.py deleted file mode 100644 index 5d5f8ce966..0000000000 --- a/wagtail/contrib/wagtailmedusa/__init__.py +++ /dev/null @@ -1 +0,0 @@ -default_app_config = 'wagtail.contrib.wagtailmedusa.apps.WagtailMedusaAppConfig' diff --git a/wagtail/contrib/wagtailmedusa/apps.py b/wagtail/contrib/wagtailmedusa/apps.py deleted file mode 100644 index 98a6e46adc..0000000000 --- a/wagtail/contrib/wagtailmedusa/apps.py +++ /dev/null @@ -1,9 +0,0 @@ -from __future__ import absolute_import, unicode_literals - -from django.apps import AppConfig - - -class WagtailMedusaAppConfig(AppConfig): - name = 'wagtail.contrib.wagtailmedusa' - label = 'wagtailmedusa' - verbose_name = "Wagtail medusa" diff --git a/wagtail/contrib/wagtailmedusa/models.py b/wagtail/contrib/wagtailmedusa/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/wagtail/contrib/wagtailmedusa/renderers.py b/wagtail/contrib/wagtailmedusa/renderers.py deleted file mode 100644 index ba9e9495f5..0000000000 --- a/wagtail/contrib/wagtailmedusa/renderers.py +++ /dev/null @@ -1,28 +0,0 @@ -from __future__ import absolute_import, unicode_literals - -from django_medusa.renderers import StaticSiteRenderer -from wagtail.wagtailcore.models import Site -from wagtail.wagtaildocs.models import get_document_model - - -class PageRenderer(StaticSiteRenderer): - def get_paths(self): - # Get site - # TODO: Find way to get this to work with other sites - site = Site.objects.filter(is_default_site=True).first() - if site is None: - return [] - - # Return list of paths - return site.root_page.get_static_site_paths() - - -class DocumentRenderer(StaticSiteRenderer): - def get_paths(self): - Document = get_document_model() - - # Return list of paths to documents - return (doc.url for doc in Document.objects.all()) - - -renderers = [PageRenderer, DocumentRenderer]