Installation & Setup¶
Requirements¶
Django 5.2+ (LTS)
Django REST Framework
djgentelella(core package)
Optional:
Celery, for queue-backed sending —
pip install djgentelella[celery]. Without it the module falls back toSyncBackendand sends in-process.Django Channels (if using WebSocket features) —
pip install djgentelella[firmador]
Adding to INSTALLED_APPS¶
Add djgentelella.async_notification to your INSTALLED_APPS:
INSTALLED_APPS = [
...,
'djgentelella',
'rest_framework',
'djgentelella.async_notification',
]
Running Migrations¶
python manage.py migrate
This creates the following database tables:
async_notification_emailtemplateasync_notification_emailnotificationasync_notification_attachedfileasync_notification_newslettertemplateasync_notification_newsletterasync_notification_newslettertask
URL Configuration¶
Include the async_notification URLs in your project’s urls.py:
from django.urls import path, include
urlpatterns = [
...,
path('async_notification/',
include('djgentelella.async_notification.urls')),
]
The module registers the following URL patterns:
objapi/- DRF router for all API ViewSetsemail-notifications/- Email notification management pageemail-templates/- Email template management pagenewsletters/- Newsletter management pagenewsletter-templates/- Newsletter template management pagenewsletter-tasks/- Newsletter task management pageautocomplete/- Recipient autocomplete endpointmodel-fields/- Model field introspection endpointupload-image/- Image upload for TinyMCE editorupload-video/- Video upload for TinyMCE editorpreview-file/<int:pk>/- Serve an attached filereassociate-files/- Reassociate uploaded files with a real objectpreview-template/- Template preview rendering
Permissions¶
All views require authentication (@login_required for HTML views, SessionAuthentication for API).
The API ViewSets use AuthAllPermBaseObjectManagement with Django model permissions:
async_notification.view_emailnotificationasync_notification.add_emailnotificationasync_notification.change_emailnotificationasync_notification.delete_emailnotification
And equivalents for emailtemplate, newslettertemplate, newsletter, and newslettertask.
Make sure to assign the appropriate permissions to users or groups that need access to the management UI.