You have some problem with django 1.10
Opened this issue · 5 comments
You have some problem with django 1.10
TypeError: 'LoggingMiddleware' object is not callable File "django/core/handlers/exception.py",
In django 1.10 your middleware class should be child of "MiddlewareMixin"
Thanks, going to look into that.
Ref.: https://docs.djangoproject.com/en/1.11/topics/http/middleware/
Somewhere I keep getting this error from the package -
TypeError: %d format: a number is required, not unicode
Logged from file middleware.py, line 125
Traceback (most recent call last):
File "/usr/lib/python2.7/logging/init.py", line 861, in emit
msg = self.format(record)
File "/usr/lib/python2.7/logging/init.py", line 734, in format
return fmt.format(record)
File "/usr/lib/python2.7/logging/init.py", line 465, in format
record.message = record.getMessage()
File "/usr/lib/python2.7/logging/init.py", line 329, in getMessage
msg = msg % self.args
TypeError: %d format: a number is required, not unicode
Your create_logger seems to have an issue -
Making below change fixes the issue i.e replace %d with %s -
log_msg = (
"%(remote_address)s %(user_email)s %(method)s %(url)s %(status)s "
"%(content_length)s (%(request_time).2f seconds)"
)
Do you want me to raise a PR to fix this dude?
content_length and status attributes
Yes, a PR would be nice. Thanks for reporting this.