Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top