Opened 12 years ago

Closed 12 years ago

#1630 closed enhancement (worksforme)

add "host" and "path" to DjangoContext

Reported by: oggie rob Owned by: Adrian Holovaty
Component: contrib.admin Version: 0.91
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Nice to have host and relative path info in DjangoContext when generating sub-urls or redirections

Rather than attaching a diff I'll just specify 2 lines that one could add to the core.extensions.DjangoContext.init

selfhost? = request.METAHTTP_HOST?
selfpath? = request.METAPATH_INFO?

Change History (2)

comment:1 Changed 12 years ago by oggie rob

Damn, forgot about formatting. That is:

        self['host'] = request.META['HTTP_HOST']
        self['path'] = request.META['PATH_INFO']

comment:2 Changed 12 years ago by Adrian Holovaty

Resolution: worksforme
Status: newclosed

You can do that yourself using the TEMPLATE_CONTEXT_PROCESSORS framework.

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