I’m trying to create a simple route for a about page:
path(‘about/‘ aboutpage_view, as_view(), name=‘about’)
But it’s not working,
It says it can’t find the name, then also it can’t find the views.
I named it def aboutpage_view
I’m trying to create a simple route for a about page:
path(‘about/‘ aboutpage_view, as_view(), name=‘about’)
But it’s not working,
It says it can’t find the name, then also it can’t find the views.
I named it def aboutpage_view
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (7)
As H lee said if it's a functional view you need to link your app.urls in the main project URLs and then you can do
from app import viewsthen in your app URLs you can add views.aboutpage_viewMake sure you have an about view:
Take a look at this dev.to/merichard123/django-diaries...
If it's a class based view do the same but add the as_view() method to the view parameter
This is what I have
It’s not working
Are you getting any errors? Is your code on GitHub?
If it's a class based view, the as_view function is a member of the class View, that you inherited from:
If it's a functional view, you don't even need the as_view function:
Oh and don't forget the comma after the first parameter.
It starts out as def aboutpage_view,
I tried that but it didn’t work
It was the templates folder, it wasn’t with manage.py