summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-04-29 03:04:00 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-04-29 03:04:00 +0000
commit7543588860906b754afb9d064f0f3e72a9ee337b (patch)
treef09cf476c05d0209d31125a74af7edfa6be21b1d
parent71468fad80e1a7676c403bd1fc961e405c08914c (diff)
downloaddjango-7543588860906b754afb9d064f0f3e72a9ee337b.tar.gz
magic-removal: Proofread docs/static_files.txt
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2790 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--docs/static_files.txt16
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/static_files.txt b/docs/static_files.txt
index 333bb12e22..d8d90e52d5 100644
--- a/docs/static_files.txt
+++ b/docs/static_files.txt
@@ -31,7 +31,7 @@ How to do it
Just put this in your URLconf_::
- (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),
+ (r'^site_media/(.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),
...where ``site_media`` is the URL where your media will be rooted, and
``/path/to/media`` is the filesystem root for your media.
@@ -60,7 +60,7 @@ listings for directories.
Example::
- (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media', 'show_indexes': True}),
+ (r'^site_media/(.*)$', 'django.views.static.serve', {'document_root': '/path/to/media', 'show_indexes': True}),
You can customize the index view by creating a template called
``static/directory_index``. That template gets two objects in its context:
@@ -100,7 +100,7 @@ Do this by wrapping an ``if DEBUG`` statement around the
``django.views.static.serve`` inclusion. Here's a full example URLconf::
from django.conf.urls.defaults import *
- from django.conf.settings import DEBUG
+ from django.conf import settings
urlpatterns = patterns('',
(r'^/articles/2003/$', 'news.views.special_case_2003'),
@@ -109,15 +109,15 @@ Do this by wrapping an ``if DEBUG`` statement around the
(r'^/articles/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d+)/$', 'news.views.article_detail'),
)
- if DEBUG:
+ if settings.DEBUG:
urlpatterns += patterns('',
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),
)
-This code is straightforward. It imports the `DEBUG setting`_ and checks its
-value. If it evaluates to ``True``, then ``site_media`` will be associated with
-the ``django.views.static.serve`` view. If not (``DEBUG == False``), then the
-view won't be made available.
+This code is straightforward. It imports the settings and checks the value of
+the ``DEBUG`` setting. If it evaluates to ``True``, then ``site_media`` will be
+associated with the ``django.views.static.serve`` view. If not
+(``DEBUG == False``), then the view won't be made available.
Of course, the catch here is that you'll have to remember to set ``DEBUG=False``
in your production settings file. But you should be doing that anyway.