如何覆盖django-allauth中的模板? [英] How to override template in django-allauth?
问题描述
然而,我根本无法让它工作。
从示例应用设置我可以看到,django-allauth应该期望它的模板在帐户
, openid
和 socialaccount
目录。但是当我将模板放在 TEMPLATE_DIR / account / signup.html
时,它不会加载,注册
视图显示模板与django-allauth捆绑在一起我想念什么?
我最终在django-allauth之前加载了我的应用程序。在 settings.py
中:
INSTALLED_APPS =(
。
'myapp',
'allauth',
'allauth.account'
)
此解决方案与示例应用中的内容相反,但我无法以其他方式解决。
Answers in other questions leave impression that this is in fact very easy:
However, I can't get it to work at all.
From example app settings I can see that django-allauth supposedly expects it's templates to be in account
, openid
and socialaccount
directories. But when I put template at TEMPLATE_DIR/account/signup.html
it doesn't get loaded, signup
view displays template bundled with django-allauth. What do I miss?
I eventually resorted to loading my app before django-allauth. In settings.py
:
INSTALLED_APPS = (
...
'myapp',
'allauth',
'allauth.account'
)
This solution goes against what's presented in example app, but I was not able to solve it in other way.
这篇关于如何覆盖django-allauth中的模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!