Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/320.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 与#x27相反;结果';带参数';(';';,)';和关键字参数';{}';没有找到。尝试了1种模式:[';轮询/(?P<;相册id>;[0-9]+;)/results/$';]_Python_Html_Django - Fatal编程技术网

Python 与#x27相反;结果';带参数';(';';,)';和关键字参数';{}';没有找到。尝试了1种模式:[';轮询/(?P<;相册id>;[0-9]+;)/results/$';]

Python 与#x27相反;结果';带参数';(';';,)';和关键字参数';{}';没有找到。尝试了1种模式:[';轮询/(?P<;相册id>;[0-9]+;)/results/$';],python,html,django,Python,Html,Django,我正试图为相册创建一个URL,但遭到了挫折 所以我得到了这个错误(我是编程新手) 这是url.py文件 from django.conf.urls import url from . import views app_name = 'polls' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^(?P<Artist_id>[0-9]+)/$', views.detail, name='d

我正试图为相册创建一个URL,但遭到了挫折

所以我得到了这个错误(我是编程新手)

这是url.py文件

from django.conf.urls import url

from . import views

app_name = 'polls'

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^(?P<Artist_id>[0-9]+)/$', views.detail, name='detail'),
    url(r'^(?P<Album_id>[0-9]+)/results/$', views.results, name='results'),
]
从django.conf.url导入url
从…起导入视图
应用程序名称='polls'
URL模式=[
url(r'^$',views.index,name='index'),
url(r'^(?P[0-9]+)/$',views.detail,name='detail'),
url(r'^(?P[0-9]+)/results/$',views.results,name='results'),
]

它似乎是空的,因为您正在使用相册,而它只是相册。尝试使用:

<a href="{% url 'polls:results' album.id %}">

而不是:

<a href="{% url 'polls:results' Album.id %}">


(对我的英语很抱歉)

你能再帮点忙吗?:)
    {%for Album.albumTracks_set.all%}{{albumTracks.TrackTitle}{%endfor%}
我试图打印曲目,但它不会打印任何内容,我修正了它我的建议:尽量不要对变量和类使用类似的名称,将来您的代码可能无法维护。再见!
from django.conf.urls import url

from . import views

app_name = 'polls'

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^(?P<Artist_id>[0-9]+)/$', views.detail, name='detail'),
    url(r'^(?P<Album_id>[0-9]+)/results/$', views.results, name='results'),
]
<a href="{% url 'polls:results' album.id %}">
<a href="{% url 'polls:results' Album.id %}">