diff --git a/netmon2/settings.py b/netmon2/settings.py index 47930d97074079095ae871572ec67690a6ca1279..0070770c2b82adefc9195ebe12df7846007ded8d 100644 --- a/netmon2/settings.py +++ b/netmon2/settings.py @@ -33,7 +33,7 @@ ALLOWED_HOSTS = [] INSTALLED_APPS = [ "crawler.apps.CrawlerConfig", - "django_celery_results", + 'django_celery_results', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -140,6 +140,10 @@ CELERY_BEAT_SCHEDULE = { 'cleanup_expired_entries': { 'task': 'crawler.tasks.cleanup_expired_entries', 'schedule': crontab(hour="*/24"), + }, + 'check_and_notify': { + 'task': 'netmon_core.tasks.check_and_notify', + 'schedule': crontab(minute="*/1"), } } @@ -152,3 +156,25 @@ AUTHENTICATION_BACKENDS = [ LOGIN_REDIRECT_URL = 'unmonitored_nodes' LOGIN_URL = 'login' # Adjust to match your login URL pattern name + +# Email configuration +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' +EMAIL_HOST = 'your-smtp-server.com' # Replace with your SMTP server +EMAIL_PORT = 587 # Replace with your SMTP server port +EMAIL_USE_TLS = True # Use TLS for secure connection + +# Replace with your SMTP server credentials +EMAIL_HOST_USER = 'your-smtp-username' +EMAIL_HOST_PASSWORD = 'your-smtp-password' + +# Default "from" address for emails sent by Django +DEFAULT_FROM_EMAIL = 'webmaster@example.com' +SERVER_EMAIL = 'webmaster@example.com' # Email address that error messages come from + +# Additional email settings (optional) +# EMAIL_SUBJECT_PREFIX = '[Your Subject Prefix] ' +# EMAIL_TIMEOUT = 5 # Set the timeout for the email sending process +# ... + +# Optional: If you want to use console email backend for development +# EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'