Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Elia Ponzio
cynomys
Commits
a88d5ec7
Commit
a88d5ec7
authored
Jun 24, 2021
by
Elia Ponzio
Browse files
Merge branch 'dev' of git.vshn.net:elia.ponzio/generic-monitoring into dev
parents
e3ab8f26
38608663
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
a88d5ec7
...
...
@@ -29,7 +29,7 @@ A ORM will help us, TBD.
*
create database:
`CREATE DATABASE cynomys;`
*
grant user access to db:
`GRANT ALL ON cynomys TO cynomys;`
Use cockroachdb as django backend:
`
DJANGO
_DATABASE='cockroach-insecure' ./manage.py xxx`
Use cockroachdb as django backend:
`
CYNOMYS
_DATABASE='cockroach-insecure' ./manage.py xxx`
## Install
...
...
@@ -50,6 +50,7 @@ deactivate
## Run
```
export CYNOMYS_EMAIL_PASSWORD=<SUPER_SECRET>
./manage.py migrate
./manage.py createsuperuser
./manage.py runserver
...
...
project/celery.py
View file @
a88d5ec7
import
os
from
celery
import
Celery
from
django.core.mail
import
send_mail
import
subprocess
...
...
@@ -38,8 +39,15 @@ def l4_check():
pass
@
app
.
task
()
def
notify_email
():
pass
def
notify_email
(
checkTask
,
receiver
):
print
(
"Sending email from task "
+
checkTask
+
" to "
+
receiver
)
send_mail
(
"Status Change"
,
"Message which task etc."
,
None
,
[
receiver
],
fail_silently
=
False
)
@
app
.
task
()
def
notify_webhook
():
...
...
project/settings.py
View file @
a88d5ec7
...
...
@@ -100,7 +100,7 @@ DATABASES = {
}
}
default_database
=
environ
.
get
(
'
DJANGO
_DATABASE'
,
'sqlite'
)
default_database
=
environ
.
get
(
'
CYNOMYS
_DATABASE'
,
'sqlite'
)
DATABASES
[
'default'
]
=
DATABASES
[
default_database
]
# Password validation
...
...
@@ -149,3 +149,16 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# Celery settings
CELERY_BROKER_URL
=
"redis://127.0.0.1:6379/0"
CELERY_RESULT_BACKEND
=
"redis://127.0.0.1:6379/0"
# Email settings
# https://docs.djangoproject.com/en/3.2/ref/settings/#email-backend
EMAIL_HOST
=
"smtp.gmail.com"
EMAIL_HOST_USER
=
"cynomys.vshn@gmail.com"
EMAIL_HOST_PASSWORD
=
environ
.
get
(
'CYNOMYS_EMAIL_PASSWORD'
,
'sqlite'
)
EMAIL_PORT
=
587
EMAIL_SUBJECT_PREFIX
=
"[cynomys] "
EMAIL_USE_TLS
=
True
EMAIL_USE_SSL
=
False
DEFAULT_FROM_EMAIL
=
EMAIL_HOST_USER
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment