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
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
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
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
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
> 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
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
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
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
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
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
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
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
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
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
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
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
>
>
> 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
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
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
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, )
>
-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
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
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
: 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
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?
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
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
28 matches
Mail list logo