Code

Opened 4 years ago

Closed 4 years ago

#14359 closed (wontfix)

django core and contrib named urls should follow a convention

Reported by: tvon Owned by: nobody
Component: Contrib apps Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

There are a few named urls in django that don't seem to follow any particular naming convention, it might be good to come up with one and stick to it.

What I've noticed:

django.contrib.admindocs has django-admindocs-docroot (django-app-action)

django.contrib.comments uses comments-post-comment (app-action)

django.contrib.admin: uses a mix of admin:APP_MODEL_ACTION for the generated bits, and names such as password_change or logout elsewhere (just 'action')

Maybe I'm being overly anal about it, but it seems like there should be some kind of pattern here. I'm not sure what convention would make sense since you wouldn't want to tie the url name to a view or package, necessarily, but it at least seems like the urls should be somehow namespaced.

I'd file this under 'trivial' if I could...

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

I'm going to mark this wontfix.

On principle, I completely agree with you -- consistency is good.

However, there are two problems in practice.

Firstly, there is backwards compatibility. We can't simply change the name of URLs that are currently in use without breaking existing sites.

Secondly, there is the reason for the inconsistency in the first place -- changes in best practice. The admin: urls you refer to are part Django's URL namespacing system. This was introduced in Django 1.1; any app built prior to that (including many of Django's contrib apps) generally can't be deployed in a namespaced way (at least, not without difficulty).

So -- what this ticket proposes is certainly a laudable goal, but it doesn't in itself contain an actionable item.

If you want to propose a rewrite/refactor of a specific app (e.g., make comments an app that can be deployed in a namespaced way), and can propose a backwards-compatible way to gain some consistency in URL naming, that's a different matter. That constitutes a single specific goal that can be achieved. A catchall "make things more consistent" ticket doesn't help us acheive the goal of consistency.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.