Opened 9 years ago

Closed 9 years ago

#6354 closed (fixed)

django.conf.urls.shortcut is unused code, and can be removed.

Reported by: tangerine Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: orphaned urls
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Just having a look in the urls package and it seems that django.urls.shortcut is unused by the rest of the codebase and hasn't even been compiled to a .pyc on my django checkout. A quick grep didn't turn up much so I though I'd mention it here in case it needs to be removed.

Change History (5)

comment:1 Changed 9 years ago by anonymous

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Module in question is django.conf.urls.shortcut which appears to be leftover from the initial code import, rev [3].

comment:2 Changed 9 years ago by Simon Greenhill <dev@…>

Triage Stage: UnreviewedReady for checkin

comment:3 Changed 9 years ago by Simon Greenhill <dev@…>

Summary: django.urls.shortcutdjango.urls.shortcut is unused code, and can be removed.

comment:4 Changed 9 years ago by Gary Wilson

Summary: django.urls.shortcut is unused code, and can be removed.django.conf.urls.shortcut is unused code, and can be removed.

While it doesn't appear to be used in Django itself, it does still appear to be valid (the view it points to is still there). In fact, it appears that django.contrib.admin.urls could make use of it:

('^r/(\d+)/(.*)/$', 'django.views.defaults.shortcut'),

could be changed to:

('^r/', include('django.conf.urls.shortcut'),

after making the changes from [3009]. Looks like we might want to apply the [3009] changes to django.conf.urls.shortcut in case anyone is using it in their projects.

comment:5 Changed 9 years ago by Gary Wilson

Resolution: fixed
Status: newclosed

(In [7040]) Fixed #6354 -- Fixed url in django/conf/urls/ to work with non-integer primary keys (refs #2033) and made use of the URL file in the admin urls.

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