2012-07-24 38 views
3

我已經正確配置了一個Django應用程序,並讓它運行平穩。然而,當我去,使管理面板,我在取消註釋此行遇到了404錯誤:404當與Django啓用管理

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

在嘗試訪問我的網站,我收到這樣的:

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. 

我可以不知道如何解決這個錯誤。有沒有人有一些Django的經驗有解決方案?謝謝!

編輯:這裏是整個urls.py文件:

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)), 
) 
+1

似乎在當前時刻,您即將匹配'''',您的整個url文件是什麼樣子的?您訪問過哪個網址,「yourdomain」,「yourdomain /」或「yourdomain/admin」? – okm 2012-07-24 16:07:49

+0

嗨okm,我發佈整個urls.py在編輯。當我到mydomain.com時,出現錯誤,但是當我轉到mydomain.com/admin時,出現500內部服務器錯誤 – 2012-07-24 16:11:19

+1

檢查您在'INSTALLED_APPS'中列出了'django.contrib.admin' settings.py' – 2012-07-24 16:11:46

回答

0

你都試過了,http://yourdomain:port/admin?如果您使用默認網址,我會嘗試 http://127.0.0.1:8000/admin