在urls.py:Django的变量:申报网址
(r'^bbb/id(?P<user_id>[0-9]+)/$', 'django.views.generic.simple.direct_to_template,
{'template': 'some.html', 'extra_context': {'user_id': user_id}}),
在some.html:{{ user_id }}
但有一个错误:name 'user_id' is not defined (in urls.py)
那么,如何声明变量urls.py并直接发送到'some.html'?
谢谢。
非常感谢! –