Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#33774 closed Uncategorized (duplicate)

Where/how is the `application namespace` defined?

Reported by: Michael Owned by: nobody
Component: Documentation Version: 4.0
Severity: Normal Keywords: application namespace
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Firstly the documentation is excellant, thank you. The generous usage of examples really makes the documentation much easier to understand.

A weak point (IMHO) in the documentation is, the links to explain what an application namespace is link to:
https://docs.djangoproject.com/en/4.0/topics/http/urls/#term-application-namespace

Which states:

This describes the name of the application that is being deployed. 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'.

So reading this sentance, all I know is that there is this mythical creature called a application namespace lurking in my codebase somewhere. Does he live in an apps.py AppConfig.name or AppConfig.label, somewhere else ? Admin has the application namespace of admin. How was it defined, where was it defined? How do I get the application namesspace for another app?

To be honest I have learnt much more than what I could deduce from the name application namespace. Maybe I am missing the obvious here. This issue has tripped me up for years, I just try various strings until it works.

Change History (4)

comment:1 by Michael, 2 years ago

Researching this some more I see I created this forum topic about a year ago (which has no replies, so maybe its not clear what the answer is):
[Confused by Namespace vs app.name and app.label](https://forum.djangoproject.com/t/confused-by-namespace-vs-app-name-and-app-label/8873)

comment:2 by Carlton Gibson, 2 years ago

Resolution: duplicate
Status: newclosed

See the block further down: https://docs.djangoproject.com/en/4.0/topics/http/urls/#url-namespaces-and-included-urlconfs

This shows how both the application namespace, and instance namespace are specified.

I feel this query is much better targeted at the support channels. (See TicketClosingReasons/UseSupportChannels.) Following up on that forum thread would likely be a good approach.

URL namespaces are somewhat unclear/complex. To the extent that this is a request to clarify that, it's likely a duplicate of #26661, which is likely to be resolved by a documentation clarification.

comment:3 by Carlton Gibson, 2 years ago

in reply to:  2 comment:4 by Michael, 2 years ago

Replying to Carlton Gibson:

See the block further down: https://docs.djangoproject.com/en/4.0/topics/http/urls/#url-namespaces-and-included-urlconfs

This shows how both the application namespace, and instance namespace are specified.

I feel this query is much better targeted at the support channels. (See TicketClosingReasons/UseSupportChannels.) Following up on that forum thread would likely be a good approach.

URL namespaces are somewhat unclear/complex. To the extent that this is a request to clarify that, it's likely a duplicate of #26661, which is likely to be resolved by a documentation clarification.

That was a big help thank you! I now finally understand the app_name is just an unrelated variable to the AppConfig mechanism. If it was something like url_namespace (instead of app_name) that might help people understand that it's a completely separate mechanism. But maybe its just me getting tripped up by this.

Note: See TracTickets for help on using tickets.
Back to Top