From 5a0787f904945e2d1b18b65389b6f76a98b36bf5 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Fri, 1 Jul 2011 15:19:34 +0000 Subject: [1.3.X] Fixed #15974 -- Correctly link to static files handling in deployment docs. Thanks, RogueBean. Backport from trunk (r16491). git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@16492 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/howto/deployment/modpython.txt | 40 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'docs/howto/deployment/modpython.txt') diff --git a/docs/howto/deployment/modpython.txt b/docs/howto/deployment/modpython.txt index 2d4a9dafa4..f5030e9c75 100644 --- a/docs/howto/deployment/modpython.txt +++ b/docs/howto/deployment/modpython.txt @@ -246,9 +246,9 @@ Django -- for serving media. Here are some good choices: * A stripped-down version of Apache_ * Cherokee_ -If, however, you have no option but to serve media files on the same Apache -``VirtualHost`` as Django, here's how you can turn off mod_python for a -particular part of the site:: +If, however, you have no option but to serve media or static files on the +same Apache ``VirtualHost`` as Django, here's how you can turn off mod_python +for a particular part of the site:: SetHandler None @@ -257,9 +257,9 @@ particular part of the site:: Just change ``Location`` to the root URL of your media files. You can also use ```` to match a regular expression. -This example sets up Django at the site root but explicitly disables Django for -the ``media`` subdirectory and any URL that ends with ``.jpg``, ``.gif`` or -``.png``:: +This example sets up Django at the site root but explicitly disables Django +for the ``media`` and ``static`` subdirectories and any URL that ends with +``.jpg``, ``.gif`` or ``.png``:: SetHandler python-program @@ -271,11 +271,14 @@ the ``media`` subdirectory and any URL that ends with ``.jpg``, ``.gif`` or SetHandler None + + SetHandler None + + SetHandler None - .. _lighttpd: http://www.lighttpd.net/ .. _Nginx: http://wiki.nginx.org/Main .. _TUX: http://en.wikipedia.org/wiki/TUX_web_server @@ -285,22 +288,21 @@ the ``media`` subdirectory and any URL that ends with ``.jpg``, ``.gif`` or Serving the admin files ======================= -Note that the Django development server automagically serves admin media files, -but this is not the case when you use any other server arrangement. You're -responsible for setting up Apache, or whichever media server you're using, to -serve the admin files. +Note that the Django development server automagically serves the static files +of the admin app, but this is not the case when you use any other server +arrangement. You're responsible for setting up Apache, or whichever media +server you're using, to serve the admin files. -The admin files live in (:file:`django/contrib/admin/media`) of the Django -distribution. +The admin files live in (:file:`django/contrib/admin/static/admin`) of the +Django distribution. -Here are two recommended approaches: +We **strongly** recommend using :mod:`django.contrib.staticfiles` to handle +the admin files, but here are two other approaches: - 1. Create a symbolic link to the admin media files from within your - document root. This way, all of your Django-related files -- code **and** - templates -- stay in one place, and you'll still be able to ``svn - update`` your code to get the latest admin templates, if they change. + 1. Create a symbolic link to the admin static files from within your + document root. - 2. Or, copy the admin media files so that they live within your Apache + 2. Or, copy the admin static files so that they live within your Apache document root. Using "eggs" with mod_python -- cgit v1.3