On Saturday 29 December 2012, Cal Leeming [Simplicity Media Ltd] wrote:
> Since the day I started using Django, I have always used a relative path
> for TEMPLATES_DIR.
> 
> import os
> CURRENT_DIR = os.path.realpath(os.path.dirname(__file__))
> TEMPLATE_DIRS  =  "%s/templates/" % ( CURRENT_DIR, )
> 
The main point of the idea was to enable relative paths without the string 
manipulations, that is,

import os
PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
TEMPLATE_DIRS  =  ["templates/"]

It has some merit because TEMPLATE_DIRS is not the only such setting, so 
adding the project root to a path is a pattern repeated several times in the 
settings file.

> Imho, the idea of having to hard code your PROJECT_ROOT is ludicrous.
> 
Nobody suggested any such thing (well, except, maybe, the comments in the 
current default project template).

Shai.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to