无法覆盖django-allauth模板 [英] Unable to override django-allauth templates

查看:45
本文介绍了无法覆盖django-allauth模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试覆盖默认的django-allauth模板.我已经将模板从网站包中的allauth文件夹复制到了我的应用程序模板目录中.

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.

结构如下

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

我的settings.py设置了TEMPLATE_DIRS

My settings.py has the TEMPLATE_DIRS set

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

根据此答案,我在allauth之前加载了我的应用程序.

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

对我的目录中的模板进行任何更改都没有任何效果,但是更改站点包中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.

推荐答案

不确定这是否是最好的方法,但是将整个allauth目录复制到我的应用程序根目录中可以覆盖模板.

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.

这篇关于无法覆盖django-allauth模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆