#694 closed enhancement (wontfix)
TEMPLATE_DIRS should allow project root relative paths — at Version 2
Reported by: | nirvdrum | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | sorin, moeffju | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Many people develop their projects on one machine and deploy on another. The two (or more) different computers may not have the same filesystem layout and may not even be running the same OS. As such, it'd be nice if the requirement for absolute paths could be eliminated.
For my current django project, I have something like:
project/ apps/ templates/
It'd be nice if the templates directory could be specified relative to the project root.
Change History (2)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Description: | modified (diff) |
---|---|
Resolution: | → invalid |
Status: | new → closed |
(Fixed formatting in the description.)
TEMPLATE_DIRS is a setting, and each of your Django installations should have a separate settings file. This is how you designate different database passwords for different servers, for instance. The solution is to use separate settings files for your multiple environments.
Also, if that doesn't float your boat, you can use the "app_directories" template loader. See http://www.djangoproject.com/documentation/templates_python/#loader-types .
It appears that didn't format as well as I had planned. The idea is that project/ is the parent of apps/ and templates/.