DEV Community

Discussion on: How do you make a about page route?

Collapse
 
merichard123 profile image
Richard • Edited

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 views then in your app URLs you can add views.aboutpage_view

Make sure you have an about view:

#app views.py
def aboutpage_view():
      return whatever

#app URLs
urlpatterns = [
   path('about/', view.aboutpage_view, name='about')
]

# main project URLs
path("", include ('app.urls'))

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

Collapse
 
yobretyo profile image
Bret

It’s not working

Collapse
 
merichard123 profile image
Richard

Are you getting any errors? Is your code on GitHub?

Collapse
 
yobretyo profile image
Bret

This is what I have