3👍
✅
If you are testing against the default index page (the one with the “The install worked successfully! Congratulations!” greeting), it is only shown when running the development server with DEBUG = True
. In particular, it won’t be present in tests. If you want to use the view, you need to explicitly configure it in urls
module like the other views:
# urls.py
from django.urls import path
from django.views.debug import default_urlconf
urlpatterns = [
path('', default_urlconf, name='index'),
]
Source:stackexchange.com