For those confused about namespaces, I have tried to expand and clarify the 
documentation: https://github.com/django/django/pull/3092

Please give it a read and add your questions there and I'll do my best to 
answer them (with the caveat that you could include me in those who found 
the topic confusing before I worked on this).

On Wednesday, August 13, 2014 3:33:33 PM UTC-4, Tim Graham wrote:
>
> I looked into this today and couldn't see why you'd want to have a 
> different `app_name`. In fact doing so would conflict with the docs: "Every 
> instance of a single application will have the same application namespace. 
> For example, Django’s admin application has the somewhat predictable 
> application namespace of'admin'."
>
> You can deploy multiple instances of the admin site using 
> AdminSite(name='admin2') (this controls the "instance namespace"). This 
> works fine, but if you try to specify a different `app_name`, you'll get 
> broken behavior as described on the ticket. I've submitted a PR (linked 
> from the ticket) to remove it.
>
> On Friday, November 22, 2013 8:38:00 AM UTC-5, German Larrain wrote:
>>
>> I had the same confusion that you seem to have. There is a difference 
>> between application namespace and instance namespace. Because usually you 
>> only have one instance of each of the installed apps, you don't need to 
>> pass `current_app=mycoolappname_instanceX`.
>>
>> In the case of multiple admin instances, the application namespace (which 
>> is the argument `app_name` to the constructor of AdminSite, and the 
>> original topic of this post) will be 'admin' for all of them, thus the 
>> necessity to differentiate to which instance you wish to reverse a URL name 
>> by passing 'current_app' to the reverse function. Nonetheless, if none is 
>> given, the reverse will still work and will default to the first urlconf 
>> that matches the corresponding application namespace.
>>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a1502bcb-cff8-49ba-a15c-6d097d99625f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to