I just installed the django and created a new project called api.
now in api.api.urls
there is the default:
from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
so there is url pattern for the admin site, but where is the url pattern for the home page (the page with the rocket) and which view is responsible for rendering it?
EDIT:
after doing some research i accidentally found the template in django.views.templates
it is called default_urlcont.html
.
but that doesn't answer my question.
CodePudding user response:
Django shows the successful installation page if DEBUG
is set to True
in your settings and you didn't provide any custom url pattern. So to override the default behavior you need to define a pattern, for example:
from django.contrib import admin
from django.urls import path
from .views import your_view
urlpatterns = [
path('admin/', admin.site.urls),
path('', your_view),
]
This view is responsible of rendering that page.