- # root urls.py
- from django.conf.urls.defaults import *
- urlpatterns = patterns('',
- (r'^(?P<username>/w+)/blog/', include('foo.urls.blog')),
- )
- # foo/urls/blog.py
- from django.conf.urls.defaults import *
- urlpatterns = patterns('',
- (r'^$', 'foo.views.blog_index'),
- (r'^archive/$', 'foo.views.blog_archive'),
- )
- # urls.py
- from django.conf.urls.defaults import *
- urlpatterns = patterns('',
- (r'^blog/', include('inner'), {'blogid': 3}),
- )
- # inner.py
- from django.conf.urls.defaults import *
- urlpatterns = patterns('',
- (r'^archive/$', 'mysite.views.archive'),
- (r'^about/$', 'mysite.views.about'),
- (r'^rss/$', 'mysite.views.rss'),
- )
- # urls.py
- from django.conf.urls.defaults import *
- urlpatterns = patterns('',
- (r'^blog/', include('inner')),
- )
- # inner.py
- from django.conf.urls.defaults import *
- urlpatterns = patterns('',
- (r'^archive/$', 'mysite.views.archive', {'blogid': 3}),
- (r'^about/$', 'mysite.views.about', {'blogid': 3}),
- (r'^rss/$', 'mysite.views.rss', {'blogid': 3}),
- )
新闻热点
疑难解答