Opened 7 years ago

Last modified 4 years ago

#8952 new New feature

Refactor a Django "site" to be just another view function

Reported by: simon Owned by: nobody
Component: contrib.sites Version: 1.0
Severity: Normal Keywords: djangocon
Cc: Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


At the moment middleware applies globally (unless you use the decorator_from_middleware hack). A Django powered site is essentially a thing that takes an HTTP request and returns an HTTP response. We should refactor things a bit so the highlest level of a Django site is just another view, which can compose bits of middleware and a URL dispatcher. This way Django applications end up composed of nested view functions, URL dispatchers and middleware which is really elegant. It won't be easy to do this due to lots of existing code expecting things to be how they are at the moment, but it's worth investigating.

Change History (7)

comment:1 Changed 7 years ago by simon

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Getting reverse to work will be really hard.

comment:2 Changed 6 years ago by jacob

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 6 years ago by thejaswi_puthraya

  • Component changed from Uncategorized to Contrib apps

comment:4 Changed 4 years ago by gabrielhurley

  • Component changed from Contrib apps to contrib.sites

comment:5 Changed 4 years ago by lukeplant

  • Severity set to Normal
  • Type set to New feature

comment:6 follow-up: Changed 4 years ago by aaugustin

  • Easy pickings unset
  • Triage Stage changed from Design decision needed to Someday/Maybe
  • UI/UX unset

I'm not sure if it's useful to keep this ticket open after three years. Several paradigms have shifted since then.

comment:7 in reply to: ↑ 6 Changed 4 years ago by carljm

Replying to aaugustin:

I'm not sure if it's useful to keep this ticket open after three years. Several paradigms have shifted since then.

FWIW I think this is a really good idea - I don't see anything that's shifted that would make this inapplicable. It'd be one (significant) step towards reducing the dependency on global settings everywhere.

I'm not in favor of closing this ticket, but Someday/Maybe is an appropriate state for it. I'd be happy to upgrade it to Accepted, though, if someone came along who was serious about working on it :-)

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