django logout redirects me to administration page

前端 未结 11 2097
生来不讨喜
生来不讨喜 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条回答
  •  無奈伤痛
    2020-12-14 15:32

    According to docs, you can supply the next_page parameter to the logout view. https://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.views.logout

    (r'^logout/$', 'django.contrib.auth.views.logout',
        {'next_page': '/logged_out/'})
    

提交回复
热议问题