Skip to content

@kesor /sqldump_middleware.py
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Django SQL dump middleware
from django.conf import settings
from django.db import connection
class SqldumpMiddleware(object):
def process_response(self, request, response):
if settings.DEBUG and 'sqldump' in request.GET:
response.content = str(connection.queries)
response['Content-Type'] = 'text/plain'
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.