- from django.conf.urls.defaults import *
- from mysite.views import hello, current_datetime, hours_ahead
- urlpatterns = patterns('',
- (r'^hello/$', hello),
- (r'^time/$', current_datetime),
- (r'^time/plus/(/d{1,2})/$', hours_ahead),
- )
- from django.conf.urls.defaults import *
- **from mysite import views**
- urlpatterns = patterns('',
- (r'^hello/$', **views.hello** ),
- (r'^time/$', **views.current_datetime** ),
- (r'^time/plus/(d{1,2})/$', **views.hours_ahead** ),
- )
- from django.conf.urls.defaults import *
- urlpatterns = patterns('',
- (r'^hello/$', **'mysite.views.hello'** ),
- (r'^time/$', **'mysite.views.current_datetime'** ),
- (r'^time/plus/(d{1,2})/$', **'mysite.views.hours_ahead'** ),
- )
- System Message: WARNING/2 (<string>, line 99); backlink
- Inline literal start-string without end-string.
- from django.conf.urls.defaults import *
- urlpatterns = patterns(**'mysite.views'** ,
- (r'^hello/$', **'hello'** ),
- (r'^time/$', **'current_datetime'** ),
- (r'^time/plus/(d{1,2})/$', **'hours_ahead'** ),
- )
新闻热点
疑难解答