Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSimon Amz
4,606 PointsWhich directory to put templates in?
Hi there, I have a small question about creating tempaltes.
Indeed, for authentication, we often need to override some templates to customize them.
I don't understand why, for signup.html template, we had to create it in msg/accounts/templates/accounts/
whereas, for 'password_reset', 'password_reset_done', and 'password_reset_confirm', they have been created in msg/templates/registration directory
Which is the rule to know where we have to override it.
Besides, this is the same logic for urls.
Thanks for your help
2 Answers
nicole lumpkin
Courses Plus Student 5,328 PointsHi Simon Amz , I'm not sure if you're using Django or Flask, and you're definitely ahead of me in your studies, but one thing comes to mind. In Django, templates at the application level are structured like project_name/app_name/templates/app_name which looks similar to what you posted (msg/accounts/templates/accounts/). Whereas templates at the project level are structured like project_name/templates/ which looks similar to (msg/templates/registration directory). Not sure if this is helpful :) good luck!
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsI don't understand why, for signup.html template, we had to create it in msg/accounts/templates/accounts/ - this is not required - you could save it in the registration folder if you prefer to save it there instead
Simon Amz
4,606 PointsSimon Amz
4,606 PointsIt's exactly this. And the project is on Django. So the question is how do we know if we have to put templates at project level or app level?