django logout redirects me to administration page

前端 未结 11 2124
生来不讨喜
生来不讨喜 2020-12-14 14:32

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\'))         


        
11条回答
  •  旧时难觅i
    2020-12-14 15:28

    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/'
    

提交回复
热议问题