About Redirecting to Another Page
You can redirect a URL to another page using one of the following:
from django.urls import path
from django.shortcuts import redirect
urlpatterns = [
path("", lambda request: redirect("dashboard")),
]
or
from django.urls import path, reverse_lazy
from django.views.generic import RedirectView
urlpatterns = [
path("", RedirectView.as_view(url=reverse_lazy("dashboard"))),
]
Tips and Tricks Programming Django 4.2 Django 3.2 Django 2.2
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent app
For Django websites that use cookies.
Django App for You