Python新手,刚开始使用涉及API模块的问题报告应用程序。
我的Urls.py文件:
urlpatterns = patterns('',
url(r'^api/', include('api.urls')),
)
我的api.urls文件
urlpatterns = patterns('api.v1',
# Examples:
# url(r'^$', 'newproject.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
# authentication / session managemen
url(r'^auth/profile/me/$', 'account', name='my-account'),
url(r'^auth/profile/$', 'new_account', name='new-account'),
url(r'^auth/session/(?P<key>[a-z0-9]{64})/$', 'session', name='existing-session'),
url(r'^auth/session/$', 'new_session', name='new-session'),
....
我的网页404错误
Using the URLconf defined in newproject.urls, Django tried these URL patterns, in this order:
^api/
The current URL, , didn't match any of these.
我可能会忽略我犯的错误...... 请帮忙? 使用Django 1.9.7
答案 0 :(得分:1)
将url(r'^api/', include('api.urls')),
替换为url(r'', include('api.urls')),