Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to solve this problem ? "You don't have permission to edit anything. " in django

Tags:

django

i created a superuser account , but when I log in with it , i can't edit any of the installed applications !

how can I grant permissions for this user to allow editing applications ??

like image 811
Adham Avatar asked Dec 08 '10 21:12

Adham


4 Answers

Try adding the line admin.autodiscover() to your main urls.py, making sure to do from django.contrib import admin first.

see this answer

like image 141
UXE Avatar answered Oct 18 '22 17:10

UXE


Found this info useful in this context.

So simply replace django.contrib.admin with django.contrib.admin.apps.SimpleAdminConfig in installed apps.

from adminplus.sites import AdminSitePlus

#Add this line.  
admin.site = AdminSitePlus()
admin.autodiscover()  # automatic autodiscover should be turned off in settings
like image 32
nuhbye Avatar answered Oct 18 '22 19:10

nuhbye


Have you created admin.py files for all your apps, registered the models, and called admin.site.register() in urls.py?

like image 33
Daniel Roseman Avatar answered Oct 18 '22 18:10

Daniel Roseman


I had this problem happen upgrading from Django 1.6 -> 1.8. The solution for me turned out to be simply removing admin.site = AdminSitePlus() from the top of my urls.py. So, this:

admin.site = AdminSitePlus()
admin.autodiscover()

became this:

admin.autodiscover()
like image 1
Bobby Avatar answered Oct 18 '22 19:10

Bobby