Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何将index.html页面的href id捕获到my views.py文件中,并使用它在Django中呈现我的第二个html页面_Python_Html_Django_Hyperlink - Fatal编程技术网

Python 如何将index.html页面的href id捕获到my views.py文件中,并使用它在Django中呈现我的第二个html页面

Python 如何将index.html页面的href id捕获到my views.py文件中,并使用它在Django中呈现我的第二个html页面,python,html,django,hyperlink,Python,Html,Django,Hyperlink,我的HTML代码 如果我缺少某些内容,请告诉我。替换msg=request.POST.get'd'with msg=d将作为参数发送到视图。你不需要这个请求。非常感谢karthikr,成功了!谢谢你。我想出来了 <html> {% for d in name %} <li><a id = {{d}} alt={{d|slugify }} href ="/hindi_guitarchords/{{d}}" class = "click">{{d}}</a

我的HTML代码


如果我缺少某些内容,请告诉我。替换msg=request.POST.get'd'with msg=d将作为参数发送到视图。你不需要这个请求。非常感谢karthikr,成功了!谢谢你。我想出来了
<html>
{% for d in name %}
<li><a id = {{d}} alt={{d|slugify }} href ="/hindi_guitarchords/{{d}}" 
class = "click">{{d}}</a> </li>
{% endfor %}
</html>
url(r'^hindi_guitarchords/(?P<d>.*)/$', 'guitarchordsapp.views.hindi_guitarchords'),
def hindi_guitarchords(request, d):
    msg = request.POST.get('d')
    #msg= get_object_or_404(Post,slug=d)

    return render_to_response('hindi_guitarchords.html',{'song_name':msg})