我是Django的新手,现在我正在努力建立一个使用它的简单网店。今天我意识到我需要一些调试工具,所以我选择了django-debug-toolbar
。我设置它就像它在这里解释的那样 - How do I see the Django debug toolbar?。但是当我将DEBUG
设置为True
时,我会收到一条消息 -
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/
Using the URLconf defined in urlconf, Django tried these URL patterns, in this order:
^__debug__/m/(.*)$
^__debug__/sql_select/$ [name='sql_select']
^__debug__/sql_explain/$ [name='sql_explain']
^__debug__/sql_profile/$ [name='sql_profile']
^__debug__/template_source/$ [name='template_source']
The current URL, , didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
这是我的应用程序的urls.py:
from django.conf.urls import patterns, url
urlpatterns = patterns('ecommerce.views',
url(r'^profile/$', 'profile'),
url(r'^login/$', 'login_user'),
url(r'^logout/$', 'logout_user'),
url(r'^registration/$', 'registration'),
)
据我所知,现在django不是在我的应用程序的urls.py中查找合适的网址,而是在其他地方查找。