Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is it not sensible to store Django templates within their associated apps?

Per the winning answer to this question and per everything else I've read on the interwebs, you're most likely going to put Django templates for mySubAppX in a folder outside of mySubAppX - most commonly myProject/templates/mySubAppX where templates is a directory sibling to the actual mySubAppX directory where the app is stored.

Why? Especially when you're making sub applications to be modular why?

like image 467
JnBrymn Avatar asked Dec 09 '22 19:12

JnBrymn


1 Answers

It's not a rule and depends. There is supporter for the inside-app solution also.

In the centralized-template way, templates/app/template_name, locating a template is fast and template names could be as simple as app/item.html; you could easily manage/move the whole directory to some place such as memory-disk as well.

On the other hand, the inside-app ways, app/templates/app_template_name or app/templates/app/template_name, work better for packaged apps. For editing, my colleague found that the inside-app solution is more convenient for developing in Eclipse, anyway.

like image 184
okm Avatar answered Dec 21 '22 23:12

okm