diff options
| author | Gabriel Hurley <gabehr@gmail.com> | 2010-10-19 00:11:51 +0000 |
|---|---|---|
| committer | Gabriel Hurley <gabehr@gmail.com> | 2010-10-19 00:11:51 +0000 |
| commit | 9dfdcf86befecad3b638df03273719c5ada90a45 (patch) | |
| tree | 9d4156d929684d3166f5dd4a951a321f36363d66 /docs/topics/http | |
| parent | efcb7776a0209447cc8ac3eb12760c197eeed7bb (diff) | |
[1.2.X] Fixed #14426 -- Removed "mysite" import statements from examples that might teach people "bad habits" in regards to creating reusable apps.
Thanks to idahogray for assisting with the patch (and sorry for forgetting the attribution in the patch on trunk).
Backport of [14270] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14271 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics/http')
| -rw-r--r-- | docs/topics/http/urls.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt index 1a152ade5d..d176bbafae 100644 --- a/docs/topics/http/urls.txt +++ b/docs/topics/http/urls.txt @@ -338,12 +338,12 @@ Here's the example URLconf from the :doc:`Django overview </intro/overview>`:: from django.conf.urls.defaults import * urlpatterns = patterns('', - (r'^articles/(\d{4})/$', 'mysite.news.views.year_archive'), - (r'^articles/(\d{4})/(\d{2})/$', 'mysite.news.views.month_archive'), - (r'^articles/(\d{4})/(\d{2})/(\d+)/$', 'mysite.news.views.article_detail'), + (r'^articles/(\d{4})/$', 'news.views.year_archive'), + (r'^articles/(\d{4})/(\d{2})/$', 'news.views.month_archive'), + (r'^articles/(\d{4})/(\d{2})/(\d+)/$', 'news.views.article_detail'), ) -In this example, each view has a common prefix -- ``'mysite.news.views'``. +In this example, each view has a common prefix -- ``'news.views'``. Instead of typing that out for each entry in ``urlpatterns``, you can use the first argument to the ``patterns()`` function to specify a prefix to apply to each view function. @@ -352,7 +352,7 @@ With this in mind, the above example can be written more concisely as:: from django.conf.urls.defaults import * - urlpatterns = patterns('mysite.news.views', + urlpatterns = patterns('news.views', (r'^articles/(\d{4})/$', 'year_archive'), (r'^articles/(\d{4})/(\d{2})/$', 'month_archive'), (r'^articles/(\d{4})/(\d{2})/(\d+)/$', 'article_detail'), |
