我试图将url参数传递给这样的django模板…
response = render_to_string('persistConTemplate.html', request.GET)
这是来自我的views.py文件的调用行。 persistConTemplate.html是我的模板和request.GET的名称.GET是包含url参数的字典。
在模板中,我尝试使用这样的参数之一…
{% for item in (numItems) %}
item {{item}}
{% endfor %}
numItems是我在我的请求中发送的url参数之一…
http:/someDomain/persistentConTest.html/?numItems=12
当我尝试上面的for循环,我得到一个这样的输出….
image 1 image 2
我期待并希望看到图像印刷12次…
image 1 image 2 image 3 image 4 image 5 image 6 image 7 image 8 image 9 image 10 image 11 image 12
有人可以告诉我我出了什么问题吗?