Question on Template placement in file system

29 views
Skip to first unread message

Tobias Dacoir

unread,
Jan 6, 2015, 10:25:10 AM1/6/15
to django...@googlegroups.com
I have been working through the official Django 1.7 tutorial and also Tango with Django but I'm confused as to where put my templates - I want to follow best practices as much as possible.
Now currently I only plan to develop a single project with a single app, but I might want to include 3rd party apps later on.
So I have created my project and started a new app inside. Since all pages should use the same html template I wanted to place the base.html into the project template folder. Or should I still put everything into the app/template folder?

Suggestion A)
project_dir/templates/base.html
project_dir/templates/app/index.html (extends base.html)

Suggestion B)
project_dir/app_dir/templates/base.html
project_dir/app_dir/templates/index.html

Suggestion C) (as in the tutorial)
project_dir/app_dir/templates/base.html
project_dir/app_dir/templates/app/index.html


Later on when somebody goes to my website I want to show him some stuff from my app on the index page already. So on http://mysite.com/ there should already be content from my app, but there will also be static html files like 'contact', 'impress', 'help' and so on, which I wanted to put somewhere in my project folder and not within the app. But everything should rely on the same base.html template so all pages use the same javascript & css files.

Is there maybe another good tutorial for this available?

Collin Anderson

unread,
Jan 8, 2015, 2:00:31 PM1/8/15
to django...@googlegroups.com
Reply all
Reply to author
Forward
Message has been deleted
0 new messages