Django Userena-正确覆盖默认的Django应用程序模板吗?

我尝试了链接上的指示,以使用特定于我的网站的模板替换默认应用程序模板。


具体来说,我设置了以下文件结构:


project_specific_app

-templates

--userena

---files_with_same_names_as_userena_templates.html

TEMPLATE_DIRS:


TEMPLATE_DIRS = (

    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".

    # Always use forward slashes, even on Windows.

    # Don't forget to use absolute paths, not relative paths.

)

但是,当我尝试更改“ files_with_same_name_as_userena_templates.html”的内容并重新启动Web服务器时,网页不会更改


我还忘记了什么?


解决方案:在我的project / settings.py中查看TEMPLATE_DIRS并将其更改为/ absolute / path / to / project / specific / app / templates /之后,我的自定义模板起作用了。


宝慕林4294392
浏览 171回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python