Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove the "Add" functionality in Django admin [duplicate]

Is there a way to remove the "Add" functionality on the Django admin site? For certain entities, I only want the Django admin to be able to view them or change existing ones, but not add new ones.

like image 646
Krystian Cybulski Avatar asked Aug 02 '09 00:08

Krystian Cybulski


People also ask

How do you remove save and add another Django admin?

The simplest option is to set save_as=True on the ModelAdmin . This will replace the "Save and add another" button with a "Save as new" button.

What does Django admin Startproject do?

at the end of the django-admin startproject command: (env) $ django-admin startproject <projectname> . The dot skips the top-level project folder and creates your management app and the manage.py file right inside your current working directory. You might encounter this syntax in some online Django tutorials.

How do I restrict admin in Django?

Django admin allows access to users marked as is_staff=True . To disable a user from being able to access the admin, you should set is_staff=False . This holds true even if the user is a superuser. is_superuser=True .


1 Answers

See: Django Admin - Disable the 'Add' action for a specific model for true solution.

like image 91
Chris Pratt Avatar answered Oct 21 '22 12:10

Chris Pratt