Требуется помощь. Я не могу решить эту проблему. Новичок в Джанго здесь.
Traceback (most recent call last):
File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\hanya\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
TypeError: __init__() takes 1 positional argument but 2 were given
шаблон
<h1><a href="{% url 'details' Testimony.pk %}">{{testimony.Title}}</h1>
urls.py
urlpatterns = [
...
re_path('<int:pk>/', views.detail, name='details'),
]
views.py
def details(self, pk):
print('1')
Testimony=get_object_or_404(Testimony, pk= pk)
print('2')
return render(request, 'details.html', {'Testimony': Testimony})