Unable to override django-allauth templates

萝らか妹 提交于 2021-02-20 18:50:13

问题


I'm trying to override the default django-allauth templates. I've copied the templates from the allauth folder in my site-packages to my applications template directory.

The structure is as follows

myapp
--templates
----account
----admin
----socialaccount
----www
----base.html

My settings.py has the TEMPLATE_DIRS set

TEMPLATE_DIRS = (
    os.path.join(BASE_DIR, "templates"),
)

As per this answer I'm loading my application before allauth.

Making any changes to the templates in my directory doesn't have any effect, however changing the templates in the allauth templates in the site-packages outputs the changes. I know I'm missing some very basic thing here, but can't seem to figure it out.


回答1:


Not sure if this is the best approach, but copying the entire allauth directory into my applications root directory made it possible to override the templates.



来源:https://stackoverflow.com/questions/24647774/unable-to-override-django-allauth-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!