Skip to content Skip to sidebar Skip to footer

How To Change The Default Django Page To My Own One?

I'm learning Django,and I followed a guidebook.I want to change the default Django page into my own one.It has took me 2 hours to solve this,and nothing worked. The project is call

Solution 1:

it's simple. just change this

urlpatterns =[
    path('', views.home, name='home'),

to this

urlpatterns =[
    path('', learning_logs.views.index, name='home'), #correct path to your index view

Solution 2:

I don't understand what you're trying to do, why don't you just use:

urlpatterns =[
   path('', views.home, name='home'),

And change the name so it directs you to that home page instead?

E.g.

urlpatterns =[
   path('', views.learning_logs, name='learning logs'),

Also, since learning logs IS in the views file you shouldn't use

path('',learning_logs.views)

Does that make sense?


Post a Comment for "How To Change The Default Django Page To My Own One?"