You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[feature] Added notification support from openwisp_notifications #191
- Added openwisp-notification as requirement
- Added notifications to be sent for following events:
- A new device is registered automatically
- Congiguration status has changed to "error"
- Added ingore notification widget to "DeviceAdmin"
Closes#191
@@ -879,15 +892,31 @@ This signal is emitted once the device gets registered automatically through the
879
892
Setup (Integrate into other Apps)
880
893
---------------------------------
881
894
882
-
Add ``openwisp_controller`` to ``INSTALLED_APPS``:
895
+
Add ``openwisp_controller`` applications to ``INSTALLED_APPS``:
883
896
884
897
.. code-block:: python
885
898
886
899
INSTALLED_APPS= [
887
-
# other apps
888
-
'openwisp_controller',
900
+
...
901
+
# openwisp2 modules
902
+
'openwisp_controller.config',
903
+
'openwisp_controller.pki',
904
+
'openwisp_controller.geo',
905
+
'openwisp_controller.connection',
906
+
'openwisp_controller.notifications',
907
+
'openwisp_users',
908
+
'openwisp_notifications',
909
+
# openwisp2 admin theme
910
+
# (must be loaded here)
911
+
'openwisp_utils.admin_theme',
912
+
'django.contrib.admin',
913
+
'django.forms',
914
+
...
889
915
]
890
916
917
+
**Note**: The order of applications in ``INSTALLED_APPS`` should be maintained,
918
+
otherwise it might not work properly.
919
+
891
920
Add the URLs to your main ``urls.py``:
892
921
893
922
.. code-block:: python
@@ -904,6 +933,9 @@ Then run:
904
933
905
934
./manage.py migrate
906
935
936
+
**Note**: In order to properly configure notifications for your project,
937
+
please follow `setup guide of openwisp-notifications <https://github.com/openwisp/openwisp-notifications#setup-integrate-into-an-existing-django-project>`_.
938
+
907
939
Extending openwisp-controller
908
940
-----------------------------
909
941
@@ -1442,6 +1474,17 @@ Remember to change ``geo_views`` location in ``urls.py`` in point 11 for extendi
1442
1474
1443
1475
For more information about django views, please refer to the `views section in the django documentation <https://docs.djangoproject.com/en/dev/topics/http/views/>`_.
1444
1476
1477
+
Registering new notification types
1478
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1479
+
1480
+
You can define your own notification types using ``register_notification_type`` function from OpenWISP
1481
+
Notifications. For more information, see the relevant
1482
+
`documentation section about registering notification types in openwisp-notifications <https://github.com/openwisp/openwisp-notifications#registering--unregistering-notification-types>`_.
1483
+
1484
+
Once a new notification type is registered, you have to use the `"notify" signal provided in
0 commit comments