【发布时间】:2011-12-22 02:29:37
【问题描述】:
在 urls.py 中:
(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' ???
谢谢。
【问题讨论】:
标签: django django-urls