import sys from django.http import HttpRequest from django.db.backends import BaseDatabaseWrapper, util class URLCursor(util.CursorDebugWrapper): def execute(self, sql, *args): f = sys._getframe() while f: request = f.f_locals.get('request') if isinstance(request, HttpRequest): sql += ' -- %s' % repr(request.path)[2:-1].replace('%', '%%') break f = f.f_back return self.cursor.execute(sql, *args) f
{{#tags}}- {{label}}
{{/tags}}