Changeset 3505
- Timestamp:
- 07/31/06 21:23:24 (2 years ago)
- Files:
-
- django/trunk/docs/url_dispatch.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/url_dispatch.txt
r2818 r3505 264 264 265 265 urlpatterns = patterns('', 266 (r'^articles/(\d{4})/$', 'my project.news.views.year_archive'),267 (r'^articles/(\d{4})/(\d{2})/$', 'my project.news.views.month_archive'),268 (r'^articles/(\d{4})/(\d{2})/(\d+)/$', 'my project.news.views.article_detail'),269 ) 270 271 In this example, each view has a common prefix -- ``'my project.news.views'``.266 (r'^articles/(\d{4})/$', 'mysite.news.views.year_archive'), 267 (r'^articles/(\d{4})/(\d{2})/$', 'mysite.news.views.month_archive'), 268 (r'^articles/(\d{4})/(\d{2})/(\d+)/$', 'mysite.news.views.article_detail'), 269 ) 270 271 In this example, each view has a common prefix -- ``'mysite.news.views'``. 272 272 Instead of typing that out for each entry in ``urlpatterns``, you can use the 273 273 first argument to the ``patterns()`` function to specify a prefix to apply to … … 278 278 from django.conf.urls.defaults import * 279 279 280 urlpatterns = patterns('my project.news.views',280 urlpatterns = patterns('mysite.news.views', 281 281 (r'^articles/(\d{4})/$', 'year_archive'), 282 282 (r'^articles/(\d{4})/(\d{2})/$', 'month_archive'),
