arocks / edge

A Django project skeleton that is modern and cutting edge.

Home Page:http://django-edge.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

null_technical_500_response() got an unexpected keyword argument 'status_code'

opened this issue · comments

Django: 1.10
Python: 2.7.9

After migrating and launching development server by ./manage.py runserver 0.0.0.0:8002 then visiting the page I receive this:

Traceback (most recent call last):
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 170, in __call__
    response = self.get_response(request)
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/base.py", line 124, in get_response
    response = self._middleware_chain(request)
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = response_for_exception(request, exc)
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/exception.py", line 76, in response_for_exception
    response = debug.technical_500_response(request, *sys.exc_info(), status_code=400)
TypeError: null_technical_500_response() got an unexpected keyword argument 'status_code'

Changed MIDDLEWARE_CLASSES to MIDDLEWARE in base.py, and added

MIDDLEWARE += [
    'debug_toolbar.middleware.DebugToolbarMiddleware',
]

to development.py file

and now I'm receiving:

Traceback (most recent call last):
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 170, in __call__
    response = self.get_response(request)
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/base.py", line 124, in get_response
    response = self._middleware_chain(request)
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = response_for_exception(request, exc)
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/exception.py", line 86, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/exception.py", line 128, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "/home/rafal/csgopanel/src/csgopanel/wsgi.py", line 24, in null_technical_500_response
    six.reraise(exc_type, exc_value, tb)
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/utils/deprecation.py", line 136, in __call__
    response = self.get_response(request)
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = response_for_exception(request, exc)
  File "/home/rafal/.env/csgopanel/lib/python2.7/site-packages/django/core/handlers/exception.py", line 76, in response_for_exception
    response = debug.technical_500_response(request, *sys.exc_info(), status_code=400)
TypeError: null_technical_500_response() got an unexpected keyword argument 'status_code'

Hi @rafalolszewskii ,

This is possibly due to issue #67 . This has been fixed in master. Please see my comments to that issue.

Thanks,
Arun

@arocks I'm still facing this issue with Python 3.5.2 .

tks, still:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 170, in call
response = self.get_response(request)
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 124, in get_response
response = self._middleware_chain(request)
File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
response = response_for_exception(request, exc)
File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py", line 76, in response_for_exception
response = debug.technical_500_response(request, *sys.exc_info(), status_code=400)
TypeError: null_technical_500_response() got an unexpected keyword argument 'status_code'

I faced the same problem and found a solution!
ALLOWED_HOSTS seems to be necessary even if it's a debug mode.

I added below line to settings/development.py. Then debugging toolbar appeared! :)

ALLOWED_HOSTS = ["*"]