#1415 closed defect (invalid)
magic-removal .. user object not working correctly
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
same for mod_python.
Request Method: GET
Request URL: http://localhost:8080/admin/
Exception Type: AttributeError
Exception Value: 'WSGIRequest' object has no attribute '_user_source'
Exception Location: /src/django_src/django/core/handlers/wsgi.py in _get_user, line 123
Change History (10)
comment:1 by , 19 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 19 years ago
Component: | Admin interface → Core framework |
---|---|
Resolution: | invalid |
Status: | closed → reopened |
Anyway to find a solution for this?
Thx.
comment:3 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
The solution is to add
"django.contrib.auth.middleware.RequestUserMiddleware"
to your MIDDLEWARE_CLASSES tuple in settings.py.
comment:4 by , 19 years ago
manage.py startapp generation is broken in this regard (misses this entry).
comment:5 by , 19 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
The suggested bugfix did not work for me in svn r2883, the same error message keep occurring. Does not work with mod_python, apache-proxy or direct requests to the Django webserver.
comment:6 by , 19 years ago
Can you please provide more information about the error you are seeing (traceback details). Version 2883 of the code does not contain _user_source
anywhere, so you are not seeing the same bug as originally reported.
comment:7 by , 19 years ago
I used to have the same problem, until I read this: It used to be set in the mod_python and wsgi handlers. You will need to add "django.contrib.auth.middleware.AuthenticationMiddleware" somewhere after "django.contrib.sessions.middleware.SessionMiddleware" in MIDDLEWARE_CLASSES in your settings.py file. Otherwise accessing request.user will raise an AttributeError.
Could this be it?
comment:8 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
Looks like that was the problem. (See last comment.)
comment:9 by , 18 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
I just ran into this with a fresh svn checkout, I think manage.py startapp should be fixed.
comment:10 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
See the previous comments for the solution to the problem.
akaihola solved it..
needed to add some new middleware