我正在使用python默认开发http服务器,它工作正常。错误,当前 URL,,不匹配任何这些,在“http://127.0.0.1:8000 我的软件版本:django 1.4 python 2.6.6
我的 urls.py 文件:
from django.conf.urls import patterns, include, url
#from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'djproject.views.home', name='home'),
# url(r'^djproject/', include('djproject.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# url(r'^admin/', admin.site.urls),
url(r'^admin/', admin.site.urls),
)
错误:
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/
Using the URLconf defined in djproject.urls, Django tried these URL patterns, in this order:
^admin/
The current URL, , didn't match any of these.