-2

I created my own Auth app, and now Admin is not working, what can you suggest?

Exception now is: 'User' object has no attribute 'is_authenticated'

I know my User really have no such method. So I have 2 ways: - change admin - adapt my user system

My question was: is there possibility to easily off admin bound to auth

Igor Golodnitsky
  • 4,456
  • 7
  • 44
  • 67
  • 5
    First, define "not working". Perhaps include an error message or stack traceback. It may help to post the code which isn't work, or produces the error message. Or, you could hope that we can guess correctly on what you did wrong. Or, if you want pointers on how to debug, you could ask a more specific question. Those are things I can suggest. – S.Lott May 06 '09 at 21:48

1 Answers1

2

See the file django/contrib/admin/views/decorators.py:

from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login

These are used in decorator staff_member_required which guards access to admin application.

Admin application requires django.contrib.auth - you might try to monkeypatch it, but it's a bad habit (Django is not RoR, Python is not Ruby).

zgoda
  • 12,775
  • 4
  • 37
  • 46
  • Actually, if you go read through AdminSite and ModelAdmin you can see pretty clearly what needs to be overridden to do custom auth schemes. Though, personally, I'd just write a backend. – James Bennett May 10 '09 at 02:28