我刚刚创建了一个新的 Django 视图。我urls.py
在其他工作 url 中添加了路径:
url(r'^events/new/$', 'crewcal.views.new_event', name='new_event'),
url(r'^commit/$', 'crewcal.views.commit'),
url(r'^user/(?P<user_id>\d+)/$', profile, name='profile'),
其他工作正常。我已重新启动服务器并尝试发出请求,但出现此错误。任何人都可以帮忙吗?
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/commit
Using the URLconf defined in ssc.urls, Django tried these URL patterns, in this order:
^$ [name='home']
^events/(?P<event_id>\d+)/$
^events/new/$ [name='new_event']
^user/(?P<user_id>\d+)/$ [name='profile']
^register/$ [name='join']
^login/$
^logout/$ [name='logout']
^log_in/$ [name='log_in']
^admin/
The current URL, commit, didn't match any of these.