NewsBlur/utils/request_introspection_middleware.py
Samuel Clay dae31f712b Merge branch 'django1.6' into django1.7
* django1.6:
  Refactoring welcome screen to fix input alignment issue.
  Fixing login rotation.
  Adding cookies to path inspector.
  Upgrading httplib2.
2020-07-07 15:55:58 -04:00

10 lines
No EOL
422 B
Python

from django.conf import settings
from utils import log as logging
class DumpRequestMiddleware:
def process_request(self, request):
if settings.DEBUG:
request_data = request.POST or request.GET
request_items = request_data.items()
if request_items:
logging.debug(" ---> ~FC%s ~SN~FC%s ~SN~BC~FK%s~BK~FC" % (request.method, request.path, dict(request_items)))