Django URL 白色 space 问题
Django URL white space Issue
我刚刚安装了 Django 1.10.3 并创建了一个名为 profiles 的项目。
我在my_site/urls.py
中添加了一个urlurl(r'^profiles/', include('profiles.urls')),
并在 profiles/urls.py 中添加了:
urlpatterns = [
url(r'create^$', views.create_profile, name='create_profile'),
]
但是在我的网页上我得到了这个:
^profiles/ create^$ [name='create_profile']
因此我无法进入我的网页。请帮帮我。
我无法通过这些 url 中的任何一个看到网页:
http://localhost:8000/profiles/create
http://localhost:8000/profiles/ create
你的正则表达式搞砸了。您有:r'create^$'
。删除 ^
.
我刚刚安装了 Django 1.10.3 并创建了一个名为 profiles 的项目。
我在my_site/urls.py
中添加了一个urlurl(r'^profiles/', include('profiles.urls')),
并在 profiles/urls.py 中添加了:
urlpatterns = [
url(r'create^$', views.create_profile, name='create_profile'),
]
但是在我的网页上我得到了这个:
^profiles/ create^$ [name='create_profile']
因此我无法进入我的网页。请帮帮我。
我无法通过这些 url 中的任何一个看到网页:
http://localhost:8000/profiles/create
http://localhost:8000/profiles/ create
你的正则表达式搞砸了。您有:r'create^$'
。删除 ^
.