Django django-user-accounts 空白模板

Django django-user-accounts blank template

我已经按照 instructions for installing and setting up django-user-accounts. However I have a problem with the templates. When I try to access the views such as http://127.0.0.1:8000/account/settings/ 向我展示了一个仅包含 {# This template intentionally left blank to satisfy test suites. Your project should always provide a site_base.html itself. #}

的模板

我尝试在模板中添加 site_base.html 但没有效果。我已经尝试了主应用程序和单独的 account 目录。

非常感谢任何帮助。

我不知道 django-user-account 应用程序,但我可以在文档中看到每个操作的模板目录是:

account/login.html
account/logout.html
account/signup.html
account/signup_closed.html
...

你可以看到更多here

您是否尝试创建此文件?然后这些文件可以从 base.html.

扩展

我原来必须从 settings.py 中安装的应用程序中删除 pinax_theme_bootstrap

我刚刚 运行 遇到了同样的问题。从 INSTALLED_APPS 中删除 pinax 确实消除了错误,但实际上我仍然想要 pinax 所以我不得不进一步寻找问题的根源。对我来说,问题的根源在于我刚刚将 settings.py 拆分为 separate modules for various environments,它们都位于 settings 目录中。这导致我的 PROJECT_ROOTPACKAGE_ROOT 变量被解释为 my_project/settings/base.py 而不是 my_project/settings.py!所以 django 认为我的模板目录是 my_project/settings/templates/,当它找不到 site_base.html 时,它吓坏了。

在我的基本设置中,我修复了上述变量以向上查找一级(从它们之前的位置)一切都恢复正常:

PACKAGE_ROOT = os.path.abspath(
    os.path.join(os.path.dirname(__file__), os.pardir))
PROJECT_ROOT = os.path.abspath(
    os.path.join(PACKAGE_ROOT, os.pardir))