DEV Community

Bret
Bret

Posted on

Django views/paths to home.html and about.html

How do I create paths to load a home.html and about.html for templates?
What do the urls.py look like?

urlpatterns = [
path('admin/',admin.site.urls),

Below are the 2 I made, but it’s a error......

path('about/',views.home)

path(r'about/',views.about)

]

Top comments (1)

Collapse
 
highcenburg profile image
Vicente G. Reyes

can you post the error?

If you use Class Based Views, the path in the urls.py for this views.py example HomePage looks like: path("". HomePage.as_view(), name="home").

If you use Function Based Views, the path would be: path("", HomePage, name="home").