Django You do not have permission to edit anything.

I created a small application a while ago. I created admin.py and used admin.site.register(MenuEntry) to add the class to the admin console. He showed great items in this class. Then I started working on another application and created everything as before. But now he says: You do not have permission to edit anything. I compared the files with this and these applications, and they look very similar, so I just can’t find the difference, and I can’t figure out what to do now to make it work.

+63
python django django-admin
Sep 15 2018-10-15
source share
5 answers

I checked the files again and found the difference. I forgot to add admin.autodiscover() to the urls.py project. Thank.

+133
Sep 15 '10 at 13:48
source share

I had another case when this happened. I had an application called transcription with two models: Project and Record. Having received it mostly, I decided to rename the "recording" application. The admin application worked fine as an administrator, but any non-administrator user received this error message. In the end, I found (in my sqlite db) the django_content_type table. This one had the following entries:

 id name app_label model
 -------------------------------------
 8 project transcription project
 9 recording transcription recording
 10 project recording project
 11 recording recordings recording

Somewhere along the way, I managed to add two (almost - I don’t know why the “record” in record 10) correct records, now leaving the incorrect records intact. The admin user worked just fine (I wonder why), but any other group got an error. When I looked at auth_group_permissions. I saw that only records 8 and 9 were assigned, and, of course, there was no longer an application called transcription there. Hence the error.

I deleted entries 10 and 11 and changed app_labels 8 and 9 to “entries” and there is fun in Mudville.

+2
May 26 '13 at 14:32
source share

Upgrade your Django to version 1.7 or more. This problem will be automatically resolved.

Django update:

 pip install -U django 
+1
Feb 27 '15 at 15:05
source share

I was getting the same error and had to reorganize the app name, as it contradicted one of the modules used. My app's name was admin , and I also used Django admin .

Check the link - Change the name of the application on how to do this.

0
Aug 19 '15 at 12:38
source share

I just simply uninstalled all installed versions of Django. Then just install the latest version of Django and it works

-2
Mar 09 '15 at 6:38
source share



All Articles