#29341: Automatically Set "request.current_app" for all Request
-------------------------------------+-------------------------------------
Reporter: Luoxzhg | Owner: nobody
Type: New | Status: new
feature |
Component: Utilities | Version: master
Severity: Normal | Keywords: middleware,
Triage Stage: | current_app, request
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Django should provide a standrad middleware to add current_app attribute
to request objects.
{{{
from django.utils.deprecation import MiddlewareMixin
class CurrentAppMiddleware(MiddlewareMixin):
def process_view(self, request, *args, **kwargs):
namespace = request.resolver_match.namespace
request.current_app = namespace if namespace elsel None
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29341>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.6212e70be4cdbb955b7444c47b2f8f73%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.