Closed igorsimb closed 7 months ago
Can be done using something like this:
def index(request: HttpRequest) -> HttpResponse:
"""The entry point for the website."""
template_name = "core/index_unauthenticated.html"
if request.user.is_authenticated:
template_name = "core/index.html"
return render(request, template_name, context)
Source: https://github.com/mblayman/journal/blob/main/journal/core/views.py
Unauthenticated: index Authenticated: item_list