Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#31848 closed New feature (wontfix)

Support namespaced django.contrib.admindocs views.

Reported by: Marcelo Cardoso Owned by: nobody
Component: contrib.admindocs Version: dev
Severity: Normal Keywords: admindocs, namespaces
Cc: marcelovicentegc@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently, it is not possible to set a namespace to admindocs, as this will throw an error:

re_path(r'admin/doc/',include('django.contrib.admindocs.urls'), namespace='docs')

It requires an easy fix: to add an app_name to admindocs.

Change History (3)

comment:1 by Mariusz Felisiak, 4 years ago

Easy pickings: unset
Resolution: needsinfo
Status: newclosed
Summary: Add app_name to django.contrib.admindocs.views to make the definition of namespaces possibleSupport namespaced django.contrib.admindocs views.

Is there any reason to use namespaced django.contrib.admindocs.views? Paths contain the django-admindocs- prefix so you shouldn't have conflicts. Moreover proposed change is backward incompatible.

comment:2 by Marcelo Cardoso, 4 years ago

Yes, there is. For instance, when using admindocs, everything under it falls into the empty namespace category, which is annoying if one is trying to keep that section organized to the end user. Of course, there are workarounds, but that would save other devs some time working around it.

comment:3 by Mariusz Felisiak, 4 years ago

Resolution: needsinfowontfix

Yes, so I don't think it's worth backward incompatible change that will force other users (that use admindocs in custom pages) to update their URLs. You can always force namespaced views with:

urlpatterns = [
    ...,
    path('admin/doc/',include((django.contrib.admindocs.urls.urlpatterns, 'admindocs'), namespace='docs'))
    ...,
]

if it's really important to you.

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