why is logged_out.html not overriding in django registration?

后端 未结 2 1643
难免孤独
难免孤独 2020-12-09 10:12

I am using built-in django login and logout. In my Project/urls.py i have added url\'s for both login and logout.

from django.conf.urls import include, url
f         


        
2条回答
  •  猫巷女王i
    2020-12-09 10:49

    The django.contrib.admin app also has a registration/logged_out.html template.

    To ensure that the template from your 'account' app, is used, make sure it is above 'django.contrib.admin' in your INSTALLED_APPS setting.

    INSTALLED_APPS = (
        'account',
        ...
        'django.contrib.admin',
        ...
    )
    

    The app template loader goes through the apps in INSTALLED_APPS, and each app's template directory until it finds a match. Therefore, if admin is above your app, then Django will use the template from the admin instead of from your app.

提交回复
热议问题