i am sorry, but why should we have to render products ?
because i am passing the url pattern right ?
I followed this video here and they do not render anything. Sorry if i am wrong
VIDEO
My full Error:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 3.2.7
Python Version: 3.9.5
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'Prods']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Template error:
In template /home/firaki/Desktop/images/blog/Prods/templates/Prods/base.html, error at line 66
Reverse for 'Detail-Page' with arguments '('',)' not found. 1 pattern(s) tried: ['Products/(?P<pk>[0-9]+)/$']
56 :
57 : <div class="pa2 mb3 striped--near-white">
58 :
59 : <div class="pl2">
60 :
61 : <a href = {{ c.Links }}> <p class="mb2"><b>{{ c.Title }}</b> </a>
62 : </p>
63 :
64 : <img src = "data:image/png;base64,{{c.Images}}">
65 :
66 : <a href=" {% url 'Detail-Page' Products.id %} "> Click here to go to Product Page</a>
67 :
68 :
69 : <br>
70 :
71 : <br>
72 :
73 : </div>
74 :
75 : </div>
76 :
Traceback (most recent call last):
File "/home/firaki/.local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/firaki/.local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/firaki/Desktop/images/blog/Prods/views.py", line 32, in Index
return render(request,"Prods/base.html",context)
File "/home/firaki/.local/lib/python3.9/site-packages/django/shortcuts.py", line 19, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/loader.py", line 62, in render_to_string
return template.render(context, request)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/base.py", line 170, in render
return self._render(context)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/base.py", line 162, in _render
return self.nodelist.render(context)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/loader_tags.py", line 53, in render
result = self.nodelist.render(context)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/base.py", line 938, in render
bit = node.render_annotated(context)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/defaulttags.py", line 211, in render
nodelist.append(node.render_annotated(context))
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/home/firaki/.local/lib/python3.9/site-packages/django/template/defaulttags.py", line 446, in render
url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
File "/home/firaki/.local/lib/python3.9/site-packages/django/urls/base.py", line 86, in reverse
return resolver._reverse_with_prefix(view, prefix, *args, **kwargs)
File "/home/firaki/.local/lib/python3.9/site-packages/django/urls/resolvers.py", line 694, in _reverse_with_prefix
raise NoReverseMatch(msg)
Exception Type: NoReverseMatch at /
Exception Value: Reverse for 'Detail-Page' with arguments '('',)' not found. 1 pattern(s) tried: ['Products/(?P<pk>[0-9]+)/$']