Middleware object instantiation error in 1.10 #2205

Closed
solvire opened this Issue Jan 13, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@solvire

solvire commented Jan 13, 2017

When starting the application using django 1.10 I get an error:

Traceback (most recent call last):
  File "/Users/moz/.virtualenvs/duber/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/Users/moz/.virtualenvs/duber/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 142, in inner_run
    handler = self.get_handler(*args, **options)
  File "/Users/moz/.virtualenvs/duber/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 27, in get_handler
    handler = super(Command, self).get_handler(*args, **options)
  File "/Users/moz/.virtualenvs/duber/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 64, in get_handler
    return get_internal_wsgi_application()
  File "/Users/moz/.virtualenvs/duber/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 49, in get_internal_wsgi_application
    return import_string(app_path)
  File "/Users/moz/.virtualenvs/duber/lib/python2.7/site-packages/django/utils/module_loading.py", line 20, in import_string
    module = import_module(module_path)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/moz/Documents/projects/duber/source/duber-web/config/wsgi.py", line 31, in <module>
    application = get_wsgi_application()
  File "/Users/moz/.virtualenvs/duber/lib/python2.7/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
    return WSGIHandler()
  File "/Users/moz/.virtualenvs/duber/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 153, in __init__
    self.load_middleware()
  File "/Users/moz/.virtualenvs/duber/lib/python2.7/site-packages/django/core/handlers/base.py", line 82, in load_middleware
    mw_instance = middleware(handler)
TypeError: object() takes no parameters

I fixed the error by changing the instantiation of the middleware object to use the superclass
In oscar/apps/basket/middleware.py
Replaced
class BasketMiddleware(object):
with
class BasketMiddleware(MiddlewareMixin):

This was pulled off of master branch.
I can patch and do a pull request shortly.

solvire added a commit to solvire/django-oscar that referenced this issue Jan 13, 2017

@alexfromvl

This comment has been minimized.

Show comment
Hide comment
@alexfromvl

alexfromvl Jan 21, 2017

I have time to remove the basket from the page template. and then the error is gone. But in the course of testing the error occurred uWSGI when viewing the item card. You are not faced with such?

Error:
Exception Value:
'WSGIRequest' object has no attribute 'strategy'
Exception Location: /opt/vnv/django-oscar/src/oscar/templatetags/purchase_info_tags.py in purchase_info_for_product, line 11

alexfromvl commented Jan 21, 2017

I have time to remove the basket from the page template. and then the error is gone. But in the course of testing the error occurred uWSGI when viewing the item card. You are not faced with such?

Error:
Exception Value:
'WSGIRequest' object has no attribute 'strategy'
Exception Location: /opt/vnv/django-oscar/src/oscar/templatetags/purchase_info_tags.py in purchase_info_for_product, line 11

@mvantellingen

This comment has been minimized.

Show comment
Hide comment
@mvantellingen

mvantellingen Feb 3, 2017

Member

Should be fixed in master

Member

mvantellingen commented Feb 3, 2017

Should be fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment