diff --git a/docs/getting_started/integrating_into_django.rst b/docs/getting_started/integrating_into_django.rst index acc4081e1..b0bfdaa6c 100644 --- a/docs/getting_started/integrating_into_django.rst +++ b/docs/getting_started/integrating_into_django.rst @@ -82,6 +82,19 @@ The URL paths here can be altered as necessary to fit your project's URL scheme. In this case, this should be placed at the end of the ``urlpatterns`` list, so that it does not override more specific URL patterns. +Finally, your project needs to be set up to serve user-uploaded files from ``MEDIA_ROOT``. Your Django project may already have this in place, but if not, add the following snippet to ``urls.py``: + +.. code-block:: python + + from django.conf import settings + from django.conf.urls.static import static + + urlpatterns = [ + # ... the rest of your URLconf goes here ... + ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + +Note that this only works in development mode (``DEBUG = True``); in production, you will need to configure your web server to serve files from ``MEDIA_ROOT``. For further details, see the Django documentation: `Serving files uploaded by a user during development `_ and `Deploying static files `_. + With this configuration in place, you are ready to run ``./manage.py migrate`` to create the database tables used by Wagtail. User accounts