3

I had correctly configured a Django app and had it running smoothly. However, when I went to enable the administration panel, I encountered a 404 error upon uncommenting this line:

url(r'^admin/', include(admin.site.urls))

Upon trying to access my site, I received this:

Using the URLconf defined in cms.urls, Django tried these URL patterns, in this order:

    1. ^admin/

The current URL, , didn't match any of these.

I can't figure out how to get around this error. Does anyone with some Django experience have a solution? Thanks!

EDIT: Here is the entire urls.py file:

from django.conf.urls.defaults import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'cms.views.home', name='home'),
    # url(r'^cms/', include('cms.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/', include(admin.site.urls)),
)
4

1 回答 1

0

你试过http://yourdomain:port/admin吗,如果您使用默认网址,我会尝试 http://127.0.0.1:8000/admin

于 2013-04-01T21:33:52.300 回答