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

n7taea2i  于 2022-11-15  发布在  Go
关注(0)|答案(1)|浏览(119)

目前正在使用heroku服务器测试我的代码,但我似乎不能让它工作,因为它在我的本地主机上工作。问题是一些页面没有加载,我已经运行heroku运行bash检查和html存在
但在服务器上显示为

而在本地主机上显示

s71maibg

s71maibg1#

修复这个问题我意识到我命名的模板名称文件夹的一些代码基础上的工作在本地服务器上的上限

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'

所以我将其更改为正确的,因为我的文件夹目录不是大写的

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'

相关问题