Skip to content

Instantly share code, notes, and snippets.

@doismellburning
Created December 27, 2020 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doismellburning/63fd15f0eb9ab3180044a4451b877fcd to your computer and use it in GitHub Desktop.
Save doismellburning/63fd15f0eb9ab3180044a4451b877fcd to your computer and use it in GitHub Desktop.
# Quick example Django view to send authenticated users to a "home" page and show a landing page to others
def index(request):
if request.user.is_authenticated:
return redirect(reverse("home"))
return render(request, "oldschool/landing.html")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment