Opened 9 years ago

Closed 9 years ago

#1630 closed enhancement (worksforme)

add "host" and "path" to DjangoContext

Reported by: oggie rob Owned by: adrian
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:

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 Changed 9 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 9 years ago by adrian

  • Resolution set to worksforme
  • Status changed from new to closed

You can do that yourself using the TEMPLATE_CONTEXT_PROCESSORS framework.

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