Opened 19 years ago

Closed 19 years ago

Last modified 11 years ago

#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 Adrian Holovaty)

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 nirvdrum, 19 years ago

It appears that didn't format as well as I had planned. The idea is that project/ is the parent of apps/ and templates/.

comment:2 by Adrian Holovaty, 19 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

(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 .

Note: See TracTickets for help on using tickets.
Back to Top