django logout redirects me to administration page

前端 未结 11 2117
生来不讨喜
生来不讨喜 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:27

    If you are seeing the log out page of the Django administration site instead of your own log out page (your_application/templates/registration/logged_out.html), check the INSTALLED_APPS setting of your project and make sure that django.contrib.admin comes after 'your_application'. Both templates are located in the same relative path and the Django template loader will use the first one it finds.

提交回复
热议问题