擅长:python、mysql、java
<p>默认的Apple文件系统(APFS)不区分大小写。这意味着,在Mac开发过程中,Django能够找到模板,即使文件名的大小写不正确</p>
<p>现在您已经迁移到Ubuntu,它默认使用区分大小写的文件系统。如果案例错误,Django无法找到模板</p>
<p>注意<a href="https://docs.djangoproject.com/en/stable/topics/class-based-views/generic-display/#generic-views-of-objects" rel="nofollow noreferrer">Django docs for class-based generic views</a>状态:</p>
<blockquote>
<p>... in the absence of an explicit template Django will infer one from the object’s name ... is the lowercased version of the model’s name.</p>
</blockquote>
<p>更好的解决方案是使用小写字母重命名模板</p>