views:

535

answers:

1

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

+2  A: 

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
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