nelli
nelli

Reputation: 11

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">

Upvotes: 0

Views: 155

Answers (1)

Bob White
Bob White

Reputation: 733

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')

Upvotes: 3

Related Questions