Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auditlog error in django 1.11 #45

Open
DonOzone opened this issue May 1, 2017 · 6 comments
Open

auditlog error in django 1.11 #45

DonOzone opened this issue May 1, 2017 · 6 comments

Comments

@DonOzone
Copy link

DonOzone commented May 1, 2017

Hi,

I installed django 1.11 and followed the doc to add 'audit-log' MIDDLEWARE, the migrate was doing success, however, when I start run_server, the below error shows:
Unhandled exception in thread started by <function check_errors..wrapper at 0x7f9567d38510>
Traceback (most recent call last):
File "/home/oscar/venvs/acnts_env/lib/python3.5/site-packages/django/utils/autoreload.py", line 227, in wrapper
fn(*args, **kwargs)
File "/home/oscar/venvs/acnts_env/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 147, in inner_run
handler = self.get_handler(*args, **options)
File "/home/oscar/venvs/acnts_env/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 27, in get_handler
handler = super(Command, self).get_handler(*args, **options)
File "/home/oscar/venvs/acnts_env/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 68, in get_handler
return get_internal_wsgi_application()
File "/home/oscar/venvs/acnts_env/lib/python3.5/site-packages/django/core/servers/basehttp.py", line 47, in get_internal_wsgi_application
return import_string(app_path)
File "/home/oscar/venvs/acnts_env/lib/python3.5/site-packages/django/utils/module_loading.py", line 20, in import_string
module = import_module(module_path)
File "/home/oscar/venvs/acnts_env/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 673, in _load_unlocked
File "", line 665, in exec_module
File "", line 222, in _call_with_frames_removed
File "/srv/apps/oo/accounts/accounts/wsgi.py", line 16, in
application = get_wsgi_application()
File "/home/oscar/venvs/acnts_env/lib/python3.5/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
return WSGIHandler()
File "/home/oscar/venvs/acnts_env/lib/python3.5/site-packages/django/core/handlers/wsgi.py", line 151, in init
self.load_middleware()
File "/home/oscar/venvs/acnts_env/lib/python3.5/site-packages/django/core/handlers/base.py", line 82, in load_middleware
mw_instance = middleware(handler)
TypeError: object() takes no parameters

Though when I comment out the line:
#'audit_log.middleware.UserLoggingMiddleware',

The app would run without errors

@jeacaveo
Copy link

Found the same problem.

In Django 1.10 the load_middleware method doesn't use a parameter to create an instance of the middlewarer:

https://github.com/django/django/blob/stable/1.10.x/django/core/handlers/base.py#L58

In Django 1.11 this has changed to use a handler parameter:

https://github.com/django/django/blob/master/django/core/handlers/base.py#L41

@jeacaveo
Copy link

Found the problem, created PR #47 with fix. cc @DonOzone

@falava-carsegsa
Copy link

Any solution for this problem? When the PR #47 will be approved?

@iwalucas
Copy link

iwalucas commented Dec 5, 2017

Same issue here, any deadline for the fix?

@artemijan
Copy link

any updates?

@kpy21ui
Copy link

kpy21ui commented Jun 16, 2018

Any solution for this problem? When the PR #47 will be approved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants