Skip to content

Instantly share code, notes, and snippets.

@jgram925
Last active June 15, 2019 17:51
Show Gist options
  • Save jgram925/49d107f30312f163f788c0fcbb5513df to your computer and use it in GitHub Desktop.
Save jgram925/49d107f30312f163f788c0fcbb5513df to your computer and use it in GitHub Desktop.
Django 2.1 Login.md

settings.py

# Log In/Out Routing

LOGIN_REDIRECT_URL = 'chat'
LOGOUT_REDIRECT_URL = '/'

urls.py

Urls for Site, not App

from django.urls import path
from django.contrib.auth import views as auth

urlpatterns = [
    path('', auth.LoginView.as_view(template_name="chat/login.html"), name="login"),
    path('logout/', auth.LogoutView.as_view(next_page="/"), name="logout"),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment