每当我向http://127.0.0.1:8000/contact/?id=23 got this error:
The current URL, contact/, didn't match any of these.
Views.py
def generate_data(request, contact):
number = request.GET.get('contact', '')
return str(resp)
url.py
url(r'^data/(?P<contact>\w+)$', 'myapp.views.generate_data', name='generating data'),
template
没有views.py
。我试图根据url pattern
官方文档更改django
,但没有成功。
答案 0 :(得分:0)
尝试
url(r'^data/(?P<contact>\w+)/$', 'myapp.views.generate_data', name='generating data'),
并且您要求
> http://127.0.0.1:8000/data/< contact_id >