我很机智。我正在尝试设置 Django 管理员,但我遇到了困难。我已经按照 Django 书进行了多次检查,但语法无效(urls.py,第 23 行)。
from django.conf.urls.defaults import *
from mysite.views import hello, current_datetime, hours_ahead
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^hello/$', hello),
(r'^time/$', current_datetime),
(r'^time/plus/(\d{1,2})/$', hours_ahead),
(r'^admin/', include(admin.site.urls),
)
任何见解将不胜感激 - 谢谢!