Hi,

I have to take back my support of PROJECT_ROOT, in view of Aymeric's 
arguments. However, now I think he isn't pursuing the conclusions of the 
argument far enough:

On Tuesday 01 January 2013, Aymeric Augustin wrote:
> For instance, instead of using TEMPLATE_DIRS, project-wide templates can go
> into an "myproject" application. 
 
"There should be one-- and preferably only one --obvious way to do it". If a 
project app is the way to do it, TEMPLATE_DIRS should be deprecated. 
Conversely, at the moment, a project app is the non-obvious way to do it (and 
it carries with it further non-obviousness, like the importance of the order 
of INSTALLED_APPS).

Also, settings with essentially the same behavior:
FIXTURE_DIRS
LOCALE_PATHS
STATICFILES_DIRS (mentioned in contrib.staticfiles docs, but not main settings 
doc)

> There are two special cases that don't fit into apps: STATIC_ROOT and
> MEDIA_ROOT. (Technically, there's ALLOWED_INCLUDE_ROOTS too, but it isn't
> commonly used.)
> 
Also:
In CACHES: LOCATION when BACKEND is FileBasedCache
In DATABASES: NAME when ENGINE is sqlite3 (relative path accepted here; 
granted, sqlite3 is not recommended for production)
FILE_UPLOAD_TEMP_DIR
SESSION_FILE_PATH (for file-based sessions)

Third-party apps may add further such paths, where working data gets stored.

[Good arguments, about best practices for production and how paths relative to 
the sources' root are only acceptable for development, snipped]

> For these reasons, I'm against codifying PROJECT_ROOT and relative paths in
> Django's default settings files.

But what if we called it "WORK_FILES_ROOT" (or something similar), and made it 
clear that it's expected to lie outside the sources?

> No amount of "+1 because I'm doing it already" or blog posts will make it a
> best practice in production.
 
One point to take from those posts and reported practices, is that your 
current position does not promote the cause of keeping working-data (and work-
copies of static files) out of the source tree. instead, it promotes 
boilerplate coding in settings files, and a dangerous mixing of non-python 
source files with work-files.

I think we can (and should) do better -- deprecate the global *_DIRS settings, 
include a project app in the default settings (at least as a comment), clarify 
the importance of order in INSTALLED_APPS, and make putting the work-files out 
of the sources obvious.

My 2 cents,
        Shai.

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

Reply via email to