Giter Club home page Giter Club logo

django-smart-admin's Introduction

django-smart-admin

Pypi coverage Test

SmartAdmin is a set of small Django Admin utilities that aims to remove some of the common annoying configuration issues:

It is not intended to be a fully replacement of the official Admin, but only offers a set of mixin/utilities the often ( at least for me) need to be copied/pasted in each project.

Bonus

  • easily group models by context instead by app
  • display admin logentry for any user
  • display group members
  • display user permissions
  • display permission owners
  • Display all columns ModelAdmin mixin
  • log added/removed permissions for User/Group
  • log added/removed groups for User
  • ability to set readonly_fields = ('__all__',) (ReadOnlyMixin)
  • display all model fields in changelist (DisplayAllMixin)
  • automatically creates filter for each indexed field (SmartAutoFilterMixin)
  • improved fieldset allows the use of __others__ to include any field not included in others fieldsets (FieldsetMixin)
  • ability to customise Autocomplete labels
  • user defined "site panels"

Demo is available at https://django-smart-admin.herokuapp.com/. (Any user/password combination is accepted)

Components

  • LinkedObjectsMixin
  • ReadOnlyMixin
  • FieldsetMixin
  • DisplayAllMixin

Install

pip install django-smart-admin

or (if you want to install extra admin features)

pip install django-smart-admin[full]

In your settings.py

INSTALLED_APPS = [
    # "django.contrib.admin",  # removes standard django admin
    'django_sysinfo',  # optional
    'adminactions',  # optional
    'adminfilters',  # optional
    'admin_extra_buttons',  # optional

    'smart_admin.apps.SmartTemplateConfig',  # templates
    'smart_admin',  # use this instead of 'django.contrib.admin'

    'smart_admin.apps.SmartLogsConfig',  # optional:  log application
    'smart_admin.apps.SmartAuthConfig',  # optional: django.contrib.auth enhancements

]
SMART_ADMIN_SECTIONS = {
    'Demo': ['demo', ],
    'Security': ['auth',
                 'auth.User',
                 ],

    'Logs': ['admin.LogEntry',
             ],
    'Other': [],
    '_hidden_': ["sites"]
}

# add some bookmark
SMART_ADMIN_BOOKMARKS = [('GitHub', 'https://github.com/saxix/django-smart-admin')]

# no special permissions to see bookmarks
SMART_ADMIN_BOOKMARKS_PERMISSION = None

# add 'profile' link on the header
SMART_ADMIN_PROFILE_LINK = True

# display all users action log, not only logged user
SMART_ADMIN_ANYUSER_LOG = True

In your urls.py

from django.contrib import admin
from django.urls import include, path
import adminactions.actions as actions
from django.contrib.admin import site

admin.autodiscover()
actions.add_to_site(site)

urlpatterns = [
    path('', admin.site.urls),
    path('adminactions/', include('adminactions.urls')),
]

Project Links

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.