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)
can you post the error?
If you use
Class Based Views
, the path in theurls.py
for thisviews.py
exampleHomePage
looks like:path("". HomePage.as_view(), name="home")
.If you use
Function Based Views
, the path would be:path("", HomePage, name="home")
.