I have provided a simple login functionality. For logout, I tried to use the built-in one. This is my urls.py:
(r\'\', include(\'django.contrib.auth.urls\'))
I'm surprised no one has mentioned this, you can put this in your settings.py to redirect when logging in and logging out:
LOGIN_REDIRECT_URL = '/go-here-after-login/' LOGOUT_REDIRECT_URL = '/go-here-after-logout/'