Opened 18 years ago

Closed 18 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: no UI/UX: no

Description

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 by oggie rob, 18 years ago

Damn, forgot about formatting. That is:

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

comment:2 by Adrian Holovaty, 18 years ago

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