hln*_*hln 2 python django urlconf
我有一个链接
a href="editYou/{{costumer.slug}}"
Run Code Online (Sandbox Code Playgroud)
和URL parttern
(r'editYou/<?P(costumerSlug>.*)/$', 'editYou'),
Run Code Online (Sandbox Code Playgroud)
这指向方法
def editYou(request, costumerSlug):
Run Code Online (Sandbox Code Playgroud)
但Django显示错误:
The current URL, profile/editYou/es, didn't match any of these.
Run Code Online (Sandbox Code Playgroud)
你怎么帮我找到是什么原因?
你的模式是错的,它应该是
r'editYou/(?P<costumerSlug>.*)/$'
# ^^^^
# not <?P(costumerSlug>.*)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
59 次 |
| 最近记录: |