Re: Order of INSTALLED_APPS

2013-09-10 Thread Tim Graham
Yes, here's the ticket to add validation for 
INSTALLED_APPS: https://code.djangoproject.com/ticket/12288

On Monday, September 9, 2013 6:32:48 PM UTC-4, German Larrain wrote:
>
> Hi guys
>
> A related question: What about repeated entries of apps in INSTALLED_APPS? 
> I remember seeing this once and, if I recall correctly, no errors were 
> raised. I guess ImproperlyConfigured would be a suitable exception.
>
> Germán
>
> On Tuesday, August 13, 2013 5:09:45 AM UTC-5, Stefano Crosta wrote:
>>
>> Aymeric, Ramiro, Florian,
>>
>> thanks a lot for your answers!
>>
>> Indeed there is some (slightly hidden :D ) documentation! 
>> And it has improved since 1.5, I now see! - I remembered reading 
>> something before, but I couldn't find them anymore when I wrote yesterday's 
>> message.
>>
>> My proposal would then be to simply add another box to the 
>> https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps to 
>> say "order matters" once more and link the other two pages for translations 
>> and templates.
>> *if you think this would* help I could do it as well as a ticket. To save 
>> everybody's time no answer will mean it's not worth it!
>>
>> (PS. Also please fully disregard my momentary lapse of reason concerning 
>> `sets` in the settings - I don't know what got into me)
>>
>> thanks,
>> Stefano
>>
>>
>> On Monday, August 12, 2013 8:29:49 PM UTC+2, Florian Apolloner wrote:
>>>
>>> On Monday, August 12, 2013 3:41:15 PM UTC+2, Ramiro Morales wrote:

 For translations, we have such documentation already: 


 https://docs.djangoproject.com/en/1.5/topics/i18n/translation/#how-django-discovers-translations
  

>>>
>>> For templates too: 
>>> https://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.loaders.app_directories.Loader--
>>>  but I agree it's somewhat hidden ;) 
>>>
>>> Florian
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Order of INSTALLED_APPS

2013-09-03 Thread Kevin Christopher Henry
You're right, it would only matter if multiple apps (not core) were trying 
to use the same command. Which presumably doesn't happen very often?

I filed a ticket here: https://code.djangoproject.com/ticket/21018.


On Sunday, September 1, 2013 6:04:03 PM UTC-4, Marc Tamlyn wrote:
>
> I don't think it would break South installations as custom app commands 
> will always override builtins. Could you open a ticket for that? The 
> inconsistency is problematic. Obviously it would be backwards incompatible, 
> but we need to gauge the size of the impact.
>
> Marc
> On 1 Sep 2013 21:31, "Kevin Christopher Henry" 
>  
> wrote:
>
>> Sorry to be late to this thread, I just came across it.
>>
>> There's another place where the order of INSTALLED_APPS matters: 
>> management commands. Management commands associated with apps that come 
>> later in INSTALLED_APPS will replace those with the same name that are 
>> listed earlier. I can't find this documented anywhere, but a look at the 
>> code confirms it. South, for example, takes advantage of this to override 
>> the syncdb command (and hints at the ordering issue when the documentation 
>> says: "add 'south' to the end of INSTALLED_APPS").
>>
>> So a documentation update should probably note this specifically in the 
>> management documentation, as well as mentioning it in the box for 
>> INSTALLED_APPS. (I also think static files should also be mentioned in the 
>> box, since as Aymeric points out that is another area dependent on the 
>> order of apps.)
>>
>> One thing that's unfortunate is that the semantics of ordering for 
>> management commands is opposite that of the other cases. For templates, 
>> static files, and translations, listing an app *first *gives it 
>> precedence, whereas with management commands it's listing it *last.*Ideally 
>> this would be changed so that management commands were consistent 
>> with the other cases, but that would create serious backwards compatibility 
>> issues. Like, breaking everyone's South installation. :-O
>>
>> Cheers,
>> Kevin
>>
>>
>> On Wednesday, August 14, 2013 5:26:47 AM UTC-4, Stefano Crosta wrote:
>>>
>>> Done! 
>>> https://code.**djangoproject.com/ticket/**20914#ticket
>>>
>>> thanks!
>>>
>>> On Tuesday, August 13, 2013 12:20:48 PM UTC+2, Aymeric Augustin wrote:

 2013/8/13 Stefano Crosta 

> My proposal would then be to simply add another box to the 
> https://docs.**djangoproject.com/en/dev/ref/**settings/#installed-apps
>  to 
> say "order matters" once more and link the other two pages for 
> translations 
> and templates.
> *if you think this would* help I could do it as well as a ticket. To 
> save everybody's time no answer will mean it's not worth it!
>

 Yes, please file one, and include a link to this discussion.

 -- 
 Aymeric. 

>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-develop...@googlegroups.com .
>> To post to this group, send email to 
>> django-d...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-developers.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Order of INSTALLED_APPS

2013-09-02 Thread Shai Berger
On Monday 02 September 2013 12:34:03 VernonCole wrote:
> It also affects _how_ South works, not just _whether_ it works.  Only this
> week I had to install a patch for the formhub package which consisted of
> re-ordering INSTALLED_APPS so that tables were built in the correct order
> on PostgreSQL installations.
> 
This is getting off-topic for this list -- but South has a concept of 
dependencies between migrations, which is the right way to get migrations in 
the right order. You shouldn't depend on INSTALLED_APPS order for that.

Unless I'm missing something, in which case, let's take it to the South list.

Shai.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Order of INSTALLED_APPS

2013-09-02 Thread VernonCole
It also affects _how_ South works, not just _whether_ it works.  Only this 
week I had to install a patch for the formhub package which consisted of 
re-ordering INSTALLED_APPS so that tables were built in the correct order 
on PostgreSQL installations.

On Sunday, September 1, 2013 11:04:03 PM UTC+1, Marc Tamlyn wrote:
>
> I don't think it would break South installations as custom app commands 
> will always override builtins. Could you open a ticket for that? The 
> inconsistency is problematic. Obviously it would be backwards incompatible, 
> but we need to gauge the size of the impact.
>
> Marc
> On 1 Sep 2013 21:31, "Kevin Christopher Henry" 
>  
> wrote:
>
>> Sorry to be late to this thread, I just came across it.
>>
>> There's another place where the order of INSTALLED_APPS matters: 
>> management commands. Management commands associated with apps that come 
>> later in INSTALLED_APPS will replace those with the same name that are 
>> listed earlier. I can't find this documented anywhere, but a look at the 
>> code confirms it. South, for example, takes advantage of this to override 
>> the syncdb command (and hints at the ordering issue when the documentation 
>> says: "add 'south' to the end of INSTALLED_APPS").
>>
>> So a documentation update should probably note this specifically in the 
>> management documentation, as well as mentioning it in the box for 
>> INSTALLED_APPS. (I also think static files should also be mentioned in the 
>> box, since as Aymeric points out that is another area dependent on the 
>> order of apps.)
>>
>> One thing that's unfortunate is that the semantics of ordering for 
>> management commands is opposite that of the other cases. For templates, 
>> static files, and translations, listing an app *first *gives it 
>> precedence, whereas with management commands it's listing it *last.*Ideally 
>> this would be changed so that management commands were consistent 
>> with the other cases, but that would create serious backwards compatibility 
>> issues. Like, breaking everyone's South installation. :-O
>>
>> Cheers,
>> Kevin
>>
>>
>> On Wednesday, August 14, 2013 5:26:47 AM UTC-4, Stefano Crosta wrote:
>>>
>>> Done! 
>>> https://code.**djangoproject.com/ticket/**20914#ticket
>>>
>>> thanks!
>>>
>>> On Tuesday, August 13, 2013 12:20:48 PM UTC+2, Aymeric Augustin wrote:

 2013/8/13 Stefano Crosta 

> My proposal would then be to simply add another box to the 
> https://docs.**djangoproject.com/en/dev/ref/**settings/#installed-apps
>  to 
> say "order matters" once more and link the other two pages for 
> translations 
> and templates.
> *if you think this would* help I could do it as well as a ticket. To 
> save everybody's time no answer will mean it's not worth it!
>

 Yes, please file one, and include a link to this discussion.

 -- 
 Aymeric. 

>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-develop...@googlegroups.com .
>> To post to this group, send email to 
>> django-d...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-developers.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Order of INSTALLED_APPS

2013-09-01 Thread Marc Tamlyn
I don't think it would break South installations as custom app commands
will always override builtins. Could you open a ticket for that? The
inconsistency is problematic. Obviously it would be backwards incompatible,
but we need to gauge the size of the impact.

Marc
On 1 Sep 2013 21:31, "Kevin Christopher Henry"  wrote:

> Sorry to be late to this thread, I just came across it.
>
> There's another place where the order of INSTALLED_APPS matters:
> management commands. Management commands associated with apps that come
> later in INSTALLED_APPS will replace those with the same name that are
> listed earlier. I can't find this documented anywhere, but a look at the
> code confirms it. South, for example, takes advantage of this to override
> the syncdb command (and hints at the ordering issue when the documentation
> says: "add 'south' to the end of INSTALLED_APPS").
>
> So a documentation update should probably note this specifically in the
> management documentation, as well as mentioning it in the box for
> INSTALLED_APPS. (I also think static files should also be mentioned in the
> box, since as Aymeric points out that is another area dependent on the
> order of apps.)
>
> One thing that's unfortunate is that the semantics of ordering for
> management commands is opposite that of the other cases. For templates,
> static files, and translations, listing an app *first *gives it
> precedence, whereas with management commands it's listing it *last.*Ideally 
> this would be changed so that management commands were consistent
> with the other cases, but that would create serious backwards compatibility
> issues. Like, breaking everyone's South installation. :-O
>
> Cheers,
> Kevin
>
>
> On Wednesday, August 14, 2013 5:26:47 AM UTC-4, Stefano Crosta wrote:
>>
>> Done! 
>> https://code.**djangoproject.com/ticket/**20914#ticket
>>
>> thanks!
>>
>> On Tuesday, August 13, 2013 12:20:48 PM UTC+2, Aymeric Augustin wrote:
>>>
>>> 2013/8/13 Stefano Crosta 
>>>
 My proposal would then be to simply add another box to the
 https://docs.**djangoproject.com/en/dev/ref/**settings/#installed-apps
  to
 say "order matters" once more and link the other two pages for translations
 and templates.
 *if you think this would* help I could do it as well as a ticket. To
 save everybody's time no answer will mean it's not worth it!

>>>
>>> Yes, please file one, and include a link to this discussion.
>>>
>>> --
>>> Aymeric.
>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Order of INSTALLED_APPS

2013-09-01 Thread Kevin Christopher Henry
Sorry to be late to this thread, I just came across it.

There's another place where the order of INSTALLED_APPS matters: management 
commands. Management commands associated with apps that come later in 
INSTALLED_APPS will replace those with the same name that are listed 
earlier. I can't find this documented anywhere, but a look at the code 
confirms it. South, for example, takes advantage of this to override the 
syncdb command (and hints at the ordering issue when the documentation 
says: "add 'south' to the end of INSTALLED_APPS").

So a documentation update should probably note this specifically in the 
management documentation, as well as mentioning it in the box for 
INSTALLED_APPS. (I also think static files should also be mentioned in the 
box, since as Aymeric points out that is another area dependent on the 
order of apps.)

One thing that's unfortunate is that the semantics of ordering for 
management commands is opposite that of the other cases. For templates, 
static files, and translations, listing an app *first *gives it precedence, 
whereas with management commands it's listing it *last.* Ideally this would 
be changed so that management commands were consistent with the other 
cases, but that would create serious backwards compatibility issues. Like, 
breaking everyone's South installation. :-O

Cheers,
Kevin


On Wednesday, August 14, 2013 5:26:47 AM UTC-4, Stefano Crosta wrote:
>
> Done! https://code.djangoproject.com/ticket/20914#ticket
>
> thanks!
>
> On Tuesday, August 13, 2013 12:20:48 PM UTC+2, Aymeric Augustin wrote:
>>
>> 2013/8/13 Stefano Crosta 
>>
>>> My proposal would then be to simply add another box to the 
>>> https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps to 
>>> say "order matters" once more and link the other two pages for translations 
>>> and templates.
>>> *if you think this would* help I could do it as well as a ticket. To 
>>> save everybody's time no answer will mean it's not worth it!
>>>
>>
>> Yes, please file one, and include a link to this discussion.
>>
>> -- 
>> Aymeric. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Order of INSTALLED_APPS

2013-08-14 Thread Stefano Crosta
Done! https://code.djangoproject.com/ticket/20914#ticket

thanks!

On Tuesday, August 13, 2013 12:20:48 PM UTC+2, Aymeric Augustin wrote:
>
> 2013/8/13 Stefano Crosta 
>
>> My proposal would then be to simply add another box to the 
>> https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps to 
>> say "order matters" once more and link the other two pages for translations 
>> and templates.
>> *if you think this would* help I could do it as well as a ticket. To save 
>> everybody's time no answer will mean it's not worth it!
>>
>
> Yes, please file one, and include a link to this discussion.
>
> -- 
> Aymeric. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Order of INSTALLED_APPS

2013-08-13 Thread Aymeric Augustin
2013/8/13 Stefano Crosta 

> My proposal would then be to simply add another box to the
> https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps to say
> "order matters" once more and link the other two pages for translations and
> templates.
> *if you think this would* help I could do it as well as a ticket. To save
> everybody's time no answer will mean it's not worth it!
>

Yes, please file one, and include a link to this discussion.

-- 
Aymeric.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Order of INSTALLED_APPS

2013-08-13 Thread Stefano Crosta
Aymeric, Ramiro, Florian,

thanks a lot for your answers!

Indeed there is some (slightly hidden :D ) documentation! 
And it has improved since 1.5, I now see! - I remembered reading something 
before, but I couldn't find them anymore when I wrote yesterday's message.

My proposal would then be to simply add another box to the 
https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps to say 
"order matters" once more and link the other two pages for translations and 
templates.
*if you think this would* help I could do it as well as a ticket. To save 
everybody's time no answer will mean it's not worth it!

(PS. Also please fully disregard my momentary lapse of reason concerning 
`sets` in the settings - I don't know what got into me)

thanks,
Stefano


On Monday, August 12, 2013 8:29:49 PM UTC+2, Florian Apolloner wrote:
>
> On Monday, August 12, 2013 3:41:15 PM UTC+2, Ramiro Morales wrote:
>>
>> For translations, we have such documentation already: 
>>
>>
>> https://docs.djangoproject.com/en/1.5/topics/i18n/translation/#how-django-discovers-translations
>>  
>>
>
> For templates too: 
> https://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.loaders.app_directories.Loader--
>  but I agree it's somewhat hidden ;) 
>
> Florian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Order of INSTALLED_APPS

2013-08-12 Thread Florian Apolloner
On Monday, August 12, 2013 3:41:15 PM UTC+2, Ramiro Morales wrote:
>
> For translations, we have such documentation already: 
>
>
> https://docs.djangoproject.com/en/1.5/topics/i18n/translation/#how-django-discovers-translations
>  
>

For templates too: 
https://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.loaders.app_directories.Loader
 
-- but I agree it's somewhat hidden ;) 

Florian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Order of INSTALLED_APPS

2013-08-12 Thread Ramiro Morales
On Mon, Aug 12, 2013 at 9:59 AM, Aymeric Augustin
 wrote:
> 2013/8/12 Stefano Crosta 
>
>> There is one situation where the order of INSTALLED_APPS really matters -
>> which is template override.
>
>
> There are at least two other similar cases: translations and static files.
>
>>
>> Though not officially documented (?) I've found references in the mailing
>> list to the fact that APPS coming first in the INSTALLED_APPS will have
>> priority - their templates will be loaded effectivily overriding/shadowing
>> lower priority app ones.
>
>
> Yes, we should standardize and document that.

For translations, we have such documentation already:

https://docs.djangoproject.com/en/1.5/topics/i18n/translation/#how-django-discovers-translations

-- 
Ramiro Morales
@ramiromorales

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Order of INSTALLED_APPS

2013-08-12 Thread Aymeric Augustin
2013/8/12 Stefano Crosta 

There is one situation where the order of INSTALLED_APPS really matters -
> which is template override.
>

There are at least two other similar cases: translations and static files.


> Though not officially documented (?) I've found references in the mailing
> list to the fact that APPS coming first in the INSTALLED_APPS will have
> priority - their templates will be loaded effectivily overriding/shadowing
> lower priority app ones.
>

Yes, we should standardize and document that.

On a related note, some lookups depend on the INSTALLED_APPS settings and
others depend on the list of applications registered in the AppCache. The
latter may be a superset of the former. We should give some thought to this
problem before committing to a given discovery behavior.

Eventually, Django should probably raise an error when the AppCache loads a
model from an application than isn't in INSTALLED_APPS. But there may be
uses cases for this eg. dynamically generated models. Enough said, I'm
stopping this digression here :)


> Now, if this is "officially" confirmed in my opinion it would require:
>
>1. use a list, not a set, as a default for INSTALLED_APPS. In Python sets
>are unordered 
> as
>you surely now better than me
>
> The default generated settings file defines INSTALLED_APPS a tuple, not a
set.

We could change it to a list, however, that will introduce inconsistencies
with other settings where the default value is a tuple and can't be changed
without introducing backwards incompatibilities.

>
>1. be more explicit in the documentation
>
> Yes!

-- 
Aymeric.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.