Python django.conf.settings.ADMIN_URL Examples
The following are 1 code examples for showing how to use django.conf.settings.ADMIN_URL(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
You may check out the related API usage on the sidebar.
def process_request(self, request): request.impersonated = False if request.user.is_staff and 'impersonate_id' in request.session: user_id = request.session['impersonate_id'] if user_id: try: new_user = User.objects.get(id=user_id) except User.DoesNotExist: del request.session['impersonate_id'] else: request.impersonated = True if request.path.startswith('/' + settings.ADMIN_URL): request.new_user = new_user else: request.real_user = request.user request.user = new_user else: del request.session['impersonate_id']