Readonly models in Django admin interface?

前端 未结 14 1544
北恋
北恋 2020-12-02 05:53

How can I make a model completely read-only in the admin interface? It\'s for a kind of log table, where I\'m using the admin features to search, sort, filter etc, but there

14条回答
  •  死守一世寂寞
    2020-12-02 06:16

    read-only => views permission

    1. pipenv install django-admin-view-permission
    2. add 'admin_view_permission' to INSTALLED_APPS in the settings.py.like this: `INSTALLED_APPS = [ 'admin_view_permission',
    3. python manage.py migrate
    4. python manage.py runserver 6666

    ok.have fun with the 'views' permission

提交回复
热议问题