Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-02 Thread Luciano Pacheco
On Thu, Jan 3, 2013 at 8:17 AM, Florian Apolloner wrote: > * local_settings is imo a bad pattern as they can't easily override > anything without copying it completely into the local_settings (think of > all the settings which are dicts like DATABASES and CACHES) I use this way to allow variabl

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-02 Thread Luke Plant
On 01/01/13 18:28, Aymeric Augustin wrote: > 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.) > > Static files are collected from the apps into STATIC_ROOT that is > then served by t

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-02 Thread Florian Apolloner
Hi Ted, On Wednesday, January 2, 2013 10:26:10 PM UTC+1, ted wrote: > Florian, the method you use for environment specific settings is one of > the two most common I saw in my survey: local_settings.py being the most > common. Again, best practice vs common practice I don't know. > In my s

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-02 Thread ted
To be clear, I'm not proposing the settings.py file from my github as a django default. It is what works for me, provided for context. Florian, the method you use for environment specific settings is one of the two most common I saw in my survey: local_settings.py being the most common. Agai

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-02 Thread Florian Apolloner
Hi, On Wednesday, January 2, 2013 8:19:36 PM UTC+1, ted wrote: > > FWIW, this is a working draft of a default settings file I like that > addresses most of these issues: > https://github.com/tedtieken/django-project-skel/blob/master/project_name/settings.py > (would appreciate constructive cri

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-02 Thread ted
> A modern Django project is a collection of apps. Files are looked up under > conventional paths within apps. Modules (especially the settings module) > can live anywhere on $PYTHONPATH. Actually, there's not such thing as a > project root. > > For instance, instead of using TEMPLATE_DIRS, p

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-02 Thread Waylan Limberg
On Wed, Jan 2, 2013 at 1:36 AM, Victor Hooi wrote: > Hi, > > I may have missed it, but has been a fundamental shift in how Django looks > at projects versus applications, and how they should be laid out? > > I get the impression from Alex Gaynor's comments above that the concept of > "projects" is

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-02 Thread Daniel Sokolowski
TEMPLATE_DIRS and others in settings.py (django ticket 694) On 29/12/12 04:08, Cal Leeming [Simplicity Media Ltd] wrote: Could we not have something like this in the settings.py, which in turn enabled the code pasted above? TEMPLATE_PATH_RELATIVE=True For consistency, we'd

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread Victor Hooi
Hi, I may have missed it, but has been a fundamental shift in how Django looks at projects versus applications, and how they should be laid out? I get the impression from Alex Gaynor's comments above that the concept of "projects" is on it's way out? I know there was a change in project layout

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread Shai Berger
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 g

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread Cal Leeming [Simplicity Media Ltd]
Also the stupid thing as well, we are already using 'templatetags' and 'filters'.. I just had no idea it supported 'appname/templates' as well. *doh* Cal On Tue, Jan 1, 2013 at 8:47 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Just realised why this ha

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread Cal Leeming [Simplicity Media Ltd]
Just realised why this has been so heavily debated, and just discovered something new. https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types django.template.loaders.app_directories.Loader If 'myproject.polls' is placed into INSTALLED_APPS then Django will look at '/path/to/myproje

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread Florian Apolloner
Hi, On Tuesday, January 1, 2013 7:48:59 PM UTC+1, Cal Leeming [Simplicity Media Ltd] wrote: > > Rather than saying "spend 30 seconds thinking about it", could you perhaps > spend 30 seconds explaining why using relative paths for TEMPLATE_DIRS > would be considered a bad thing to do? I don't

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread Cal Leeming [Simplicity Media Ltd]
Just re-read my post, and realised it may have come across a bit loaded (was replying very quickly) No insult was intended, and it's a genuine question Cal On Tue, Jan 1, 2013 at 6:48 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > For the record, the onl

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread Alex Gaynor
I would like to *strongly* object to adding any notion of root path (and relative paths with it) to Django. This would be furthering the notion that a django project is a thing. It's not. You don't hear twisted people talking about the twisted project root, or any other python package. The notion o

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread Cal Leeming [Simplicity Media Ltd]
For the record, the only time I'd suggested using relative paths is for 'TEMPLATE_DIRS' only, I do not use the other two. Rather than saying "spend 30 seconds thinking about it", could you perhaps spend 30 seconds explaining why using relative paths for TEMPLATE_DIRS would be considered a bad thin

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread Aymeric Augustin
A modern Django project is a collection of apps. Files are looked up under conventional paths within apps. Modules (especially the settings module) can live anywhere on $PYTHONPATH. Actually, there's not such thing as a project root. For instance, instead of using TEMPLATE_DIRS, project-wide te

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2013-01-01 Thread ted
> > > The only option I can is whether we put that snippet of code (e.g. > PROJECT_ROOT=os.path.realpath(os.path.dirname(__file__)) ) into the > settings file generated when starting a new project. > +1 for adding this to settings, then adding a commented out os.path.join( PROJECT_ROOT, 'templ

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-30 Thread Cal Leeming [Simplicity Media Ltd]
On Sun, Dec 30, 2012 at 11:01 PM, Luke Plant wrote: > On 29/12/12 04:08, Cal Leeming [Simplicity Media Ltd] wrote: > > > Could we not have something like this in the settings.py, which in turn > > enabled the code pasted above? > > TEMPLATE_PATH_RELATIVE=True > > For consistency, we'd need STATIC

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-30 Thread Luke Plant
On 29/12/12 04:08, Cal Leeming [Simplicity Media Ltd] wrote: > Could we not have something like this in the settings.py, which in turn > enabled the code pasted above? > TEMPLATE_PATH_RELATIVE=True For consistency, we'd need STATICFILES_PATH_RELATIVE, STATIC_ROOT_PATH_RELATIVE, MEDIA_ROOT_PATH_RE

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-28 Thread Shai Berger
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, ) >

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-28 Thread Yo-Yo Ma
-1 FWIW Computing the root of your project with os.path works just fine and doesn't require another setting... which, btw, could have no sane default. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web vis

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-28 Thread Cal Leeming [Simplicity Media Ltd]
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, ) Imho, the idea of having to hard code your PROJECT_ROOT is ludicrous. I understand

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-28 Thread Luke Plant
On 28/12/12 16:42, Daniel Sokolowski wrote: > PROJECT_ROOT is what I have been using myself and seen it done by others > so to me it makes sense to introduce an official setting for this purpose. PROJECT_ROOT would still need to be defined inside the settings.py module, using the os.path.dir(__f

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-28 Thread Daniel Sokolowski
: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694) Hi, On Saturday 22 December 2012, Florian Apolloner wrote: On Saturday, December 22, 2012 10:35:59 PM UTC+1, Ben Porter wrote: > I would like to see support for relative paths. It seems the solution > is &g

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-22 Thread Shai Berger
Hi, On Saturday 22 December 2012, Florian Apolloner wrote: > On Saturday, December 22, 2012 10:35:59 PM UTC+1, Ben Porter wrote: > > I would like to see support for relative paths. It seems the solution is > > simple, but I wonder if there is some compelling reason to require > > absolute paths?

Re: Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-22 Thread Florian Apolloner
Hi, On Saturday, December 22, 2012 10:35:59 PM UTC+1, Ben Porter wrote: > > I would like to see support for relative paths. It seems the solution is > simple, but I wonder if there is some compelling reason to require absolute > paths? It would seem so but it is everything but simple: First o

Relative path support for TEMPLATE_DIRS and others in settings.py (django ticket 694)

2012-12-22 Thread Ben Porter
Hi, As per the suggestion in the ticket (https://code.djangoproject.com/ticket/694), I'm starting a thread for discussing the issue. Please see the ticket for complete context, but in summary: the TEMPLATE_DIRS list in settings.py accepts only absolute paths - and many django installations us