django-admin-notification is a Django app to display notification in Django admin panel.
django-admin-notification is a Django app to display notification in Django admin panel.
pip install django-admin-notification
admin_notification
to settings.INSTALLED_APPS
before django.contrib.admin
INSTALLED_APPS = (
#...
"admin_notification",
#...
"django.contrib.admin",
#...
)
NOTIFICATION_MODELS
: A list of models which you want to get notified about them in the django admin panel. the correct format for each element of the list is app.model
NOTIFICATION_MODELS = ['myapp.MyModel']
ADMIN_SITE_BASE_URL
: An string representing the url to django admin page, if you have changed the base url of the admin site in settings.py, the default is "admin/"
:
ADMIN_SITE_BASE_URL = 'admin_site_base_url/'
check_notifications
: This view is needed to keep track of notifications and redirecting to the corresponding models admin page. you must add this view into your urls list.
...
from admin_notification.views import check_notification_view
urlpatterns = [
path('check/notification', check_notification_view, name="check_notifications"),
...
]
Note: You are free to change the url but keep the name the same as it is in the example.
python manage.py migrate