Search code examples
pythondjangodjango-2.1

Why am I getting an error when using a django generic view?


i have just started using django, and I keep getting this error now. Also not sure how I can give an additional parameter to the view (url for example).

Will appreciate any help

In urls.py

path('page/<path:url>', TemplateView.as_view(template_name='pages/page.html'))

<a class="dropdown-item" href="{% url 'channels:page' post.url %}" target="_blank">

Solution

  • just add name='page' to your path to make a call in reverse

    path('page/', TemplateView.as_view(template_name='pages/page.html'), name='page')