我嘗試了鏈接上的指示,以使用特定于我的網(wǎng)站的模板替換默認(rèn)應(yīng)用程序模板。具體來(lái)說(shuō),我設(shè)置了以下文件結(jié)構(gòu):project_specific_app-templates--userena---files_with_same_names_as_userena_templates.htmlTEMPLATE_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.)但是,當(dāng)我嘗試更改“ files_with_same_name_as_userena_templates.html”的內(nèi)容并重新啟動(dòng)Web服務(wù)器時(shí),網(wǎng)頁(yè)不會(huì)更改我還忘記了什么?解決方案:在我的project / settings.py中查看TEMPLATE_DIRS并將其更改為/ absolute / path / to / project / specific / app / templates /之后,我的自定義模板起作用了。
Django Userena-正確覆蓋默認(rèn)的Django應(yīng)用程序模板嗎?
寶慕林4294392
2021-03-20 04:39:18