I have a project with some components that should probably be separated out into reusable apps. However, all of the templates extend a couple of base templates for the entire site. Should I include copies of the base template in each app's template directory? What is the best way to structure template directories/inheritance?

有帮助吗?

解决方案

For the purposes of your app, base.html or whatever the base template is called, should contain the entire HTML document so that it can function on its own. If end-users want to override the template, they can add their own copy to templates/yourappname/base.html and do whatever they want inside that file, including extend their main site template.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top