On Sat, Jul 19, 2008 at 12:36 PM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote:

>
> > I've tried alternating between using admin.autodiscover() in my
> > urls.py, and manually registering my models using
> > admin.site.register(Person), but I still get the permission error in
> > the admin site. I've also tried flushing the database, but that
> > doesn't seem to solve anything. FWIW, my user has is_superuser,
> > is_staff and is_active all set to true in my database.
> >
> > The exact message I get in the admin site is "You don't have
> > permission to edit anything".
>
> You'll need both the autodiscover and the admin.site.register() lines,
> not one or the other. I'm not an expert on this, but I got the same
> error message when I'd registered my models with admin.site, but not
> used autodiscover. Autodiscover registers all the apps in your
> INSTALLED_APPS settings, including django.contrib.admin, which is
> where permissions reside. If you don't use autodiscover (or don't
> explicitly register the admin models), then the django admin site has
> no way of verifying who has what permissions (or something to that
> effect).
>
> Short answer: register all your models with admin.site.register(), and
> use admin.autodiscover() too.
>
>
Yeah, I think you need both.  What autodiscover() allows you to remove (I
believe) is the previously-recommended import of your app's admin in your
__init__.py file, which could lead to exceptions due to register being
called multiple times due to your __init__ running more than once.  But I'm
not an expert on this either.

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to