Django 的 URL 正则表达式引擎失败了,我不知道为什么。甚至我的理智检查也失败了。
这是我的urls.py
:
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^a', 'placemyorder.views.home', name='home'),
)
我收到此 404 错误:
Page not found (404)
Request Method: GET
Request URL: http://[ip address]/a/
Using the URLconf defined in placemyorder.urls, Django tried these URL patterns, in this order:
1. ^a [name='home']
The current URL, , didn't match any of these.
当我访问
http://[ip address]/a
如果该信息相关,它托管在 Django 1.5.2 和 Python 2.7.3 上,位于 nginx 后面的 Ubuntu 12.04 上。