Django

Code

Ticket #1415 (closed: invalid)

Opened 3 years ago

Last modified 3 years ago

magic-removal .. user object not working correctly

Reported by: Ian@holsman.net Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

Attachments

Change History

02/28/06 04:43:06 changed by ian@holsman.net

  • status changed from new to closed.
  • resolution set to invalid.

akaihola solved it.. needed to add some new middleware

03/05/06 18:47:02 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.
  • component changed from Admin interface to Core framework.

Anyway to find a solution for this? Thx.

03/05/06 19:33:31 changed by Malcolm Tredinnick <malcolm@pointy-stick.com>

  • status changed from reopened to closed.
  • resolution set to fixed.

The solution is to add

"django.contrib.auth.middleware.RequestUserMiddleware"

to your MIDDLEWARE_CLASSES tuple in settings.py.

05/04/06 16:44:35 changed by anonymous

manage.py startapp generation is broken in this regard (misses this entry).

05/10/06 17:58:12 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

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.

05/10/06 18:24:36 changed by Malcolm Tredinnick <malcolm@pointy-stick.com>

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.

05/19/06 07:23:00 changed by verbosus

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?

05/26/06 12:06:30 changed by adrian

  • status changed from reopened to closed.
  • resolution set to invalid.

Looks like that was the problem. (See last comment.)

06/27/06 19:59:50 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

I just ran into this with a fresh svn checkout, I think manage.py startapp should be fixed.

07/21/06 10:43:35 changed by adrian

  • status changed from reopened to closed.
  • resolution set to invalid.

See the previous comments for the solution to the problem.


Add/Change #1415 (magic-removal .. user object not working correctly)




Change Properties
Action