[Django] #33774: Where/how is the `application namespace` defined?

1 view
Skip to first unread message

Django

unread,
Jun 9, 2022, 7:07:17 AM6/9/22
to django-...@googlegroups.com
#33774: Where/how is the `application namespace` defined?
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: | Status: new
Uncategorized |
Component: | Version: 4.0
Documentation | Keywords: application
Severity: Normal | namespace
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33774>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 9, 2022, 7:47:15 AM6/9/22
to django-...@googlegroups.com
#33774: Where/how is the `application namespace` defined?
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 4.0
Severity: Normal | Resolution:
Keywords: application | Triage Stage:
namespace | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Michael):

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)

--
Ticket URL: <https://code.djangoproject.com/ticket/33774#comment:1>

Django

unread,
Jun 9, 2022, 7:56:49 AM6/9/22
to django-...@googlegroups.com
#33774: Where/how is the `application namespace` defined?
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 4.0
Severity: Normal | Resolution: duplicate

Keywords: application | Triage Stage:
namespace | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => duplicate


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33774#comment:2>

Django

unread,
Jun 9, 2022, 8:09:15 AM6/9/22
to django-...@googlegroups.com
#33774: Where/how is the `application namespace` defined?
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 4.0
Severity: Normal | Resolution: duplicate
Keywords: application | Triage Stage:
namespace | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

I followed up on the forum post: https://forum.djangoproject.com/t
/confused-by-namespace-vs-app-name-and-app-label/8873/2

Hopefully that helps

--
Ticket URL: <https://code.djangoproject.com/ticket/33774#comment:3>

Django

unread,
Jun 9, 2022, 8:40:54 AM6/9/22
to django-...@googlegroups.com
#33774: Where/how is the `application namespace` defined?
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: closed
Component: Documentation | Version: 4.0
Severity: Normal | Resolution: duplicate
Keywords: application | Triage Stage:
namespace | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Michael):

Replying to [comment:2 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33774#comment:4>

Reply all
Reply to author
Forward
0 new messages