简体   繁体   English

Django 没有在我的服务器上加载一些模板

[英]Django not loading some templates on my server

Currently using heroku server to test my code but I can't seem to get it work because it working on my local host.目前使用 heroku 服务器来测试我的代码,但我似乎无法让它工作,因为它在我的本地主机上工作。 The issue is some pages are not loading and i have run heroku run bash to check and the html existed问题是某些页面没有加载,我已经运行 heroku 运行 bash 来检查并存在 html

but on server it shows但在服务器上它显示在服务器上

while on local host it shows在本地主机上显示在我的本地主机上

Fix the issue I realized I named the template name folder on some code base on caps which works on local server修复了我意识到我在本地服务器上工作的一些基于 caps 的代码库上命名了模板名称文件夹的问题

class ShippingRoutineDeleteView(StaffAndLoginRequiredMixin, DeleteView):
    model = ShippingRoutine
    success_url = reverse_lazy('order:dashboard_routine_list_create')
    template_name = 'Dashboard/routine/routine_delete.html'
    context_object_name = 'item'

so I change it to this which is the correct one because my folder directory is not on caps所以我将其更改为正确的,因为我的文件夹目录不在大写字母上

class ShippingRoutineDeleteView(StaffAndLoginRequiredMixin, DeleteView):
    model = ShippingRoutine
    success_url = reverse_lazy('order:dashboard_routine_list_create')
    template_name = 'dashboard/routine/routine_delete.html'
    context_object_name = 'item'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM