I tried to short this /project/url.py version to this:
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from django.views.generic import RedirectView
urlpatterns = [
path('admin/', admin.site.urls),
path('catalog/', include('catalog.urls')),
path('', RedirectView.as_view(url='/catalog/')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
but i get a error:
TemplateDoesNotExist at /catalog/books/
/locallibrary/templates/catalog/book_list.html (Source does not exist)
it seams like the RedirectView.as_view
does not redirect to catalog app path.
Instead it looks in the project folder locallibrary/templates
not locallibrary/catalog/templates
why?