replace 'mysite.settings' with your correct settings file, and '/path/to/mysite'
with your own project's location.
-Django doesn't serve
media files itself; it leaves that job to whichever Web
+Django doesn't serve files itself; it leaves that job to whichever Web
We recommend using a separate Web server -- i.e., one that's not also running
``VirtualHost`` as Django, you can set up Apache to serve some URLs as
static media, and others using the mod_wsgi interface to Django.
-This example sets up Django at the site root, but explicitly serves ``robots.txt``,
-``favicon.ico``, any CSS file, and anything in the ``/media/`` URL space as a static
-file. All other URLs will be served using mod_wsgi::
+This example sets up Django at the site root, but explicitly serves
+``robots.txt``, ``favicon.ico``, any CSS file, and anything in the
+``/static/`` and ``/media/`` URL space as a static file. All other URLs
+will be served using mod_wsgi::
Alias /robots.txt /usr/local/wsgi/static/robots.txt
Alias /favicon.ico /usr/local/wsgi/static/favicon.ico
AliasMatch ^/([^/]*\.css) /usr/local/wsgi/static/styles/$1
- Alias /media/ /usr/local/wsgi/static/media/
+ Alias /media/ /usr/local/wsgi/media/
+ Alias /static/ /usr/local/wsgi/static/
+ <Directory /usr/local/wsgi/media>
WSGIScriptAlias / /usr/local/wsgi/scripts/django.wsgi
.. _Apache: http://httpd.apache.org/
.. _Cherokee: http://www.cherokee-project.com/
-More details on configuring a mod_wsgi site to serve static files can be found
-in the mod_wsgi documentation on `hosting static files`_.
+.. More details on configuring a mod_wsgi site to serve static files can be found
+.. in the mod_wsgi documentation on `hosting static files`_.
.. _hosting static files: http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#Hosting_Of_Static_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
+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
+The admin files live in (:file:`django/contrib/admin/static/admin`) of the
-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
- 2. Or, copy the admin
media files so that they live within your Apache
+ 2. Or, copy the admin files so that they live within your Apache