M django_notify/admin.py => django_notify/admin.py +6 -4
@@ 1,8 1,10 @@
from django.contrib import admin
from django_notify import models
+from django_notify import settings
-admin.site.register(models.NotificationType)
-admin.site.register(models.Notification)
-admin.site.register(models.Settings)
-admin.site.register(models.Subscription)>
\ No newline at end of file
+if settings.ENABLE_ADMIN:
+ admin.site.register(models.NotificationType)
+ admin.site.register(models.Notification)
+ admin.site.register(models.Settings)
+ admin.site.register(models.Subscription)<
\ No newline at end of file
M django_notify/settings.py => django_notify/settings.py +7 -0
@@ 7,6 7,13 @@ DB_TABLE_PREFIX = 'notify'
# You need to switch this setting on, otherwise nothing will happen :)
ENABLED = getattr(django_settings, "NOTIFY_ENABLED", True)
+# Enable django-admin registration
+ENABLE_ADMIN = getattr(django_settings, "NOTIFY_ENABLE_ADMIN", False)
+
+##################################
+# PLANNED CONFIGURATION SETTINGS #
+##################################
+
# Email notifications are just optional... if you don't have access
# to a proper SMTP server, just leave it off...
SEND_EMAILS = getattr(django_settings, "NOTIFY_SEND_EMAILS", False)