doc: document sentry in deployment docs

This commit is contained in:
Alexis Métaireau 2023-12-21 22:25:30 +01:00 committed by Alexis Metaireau
parent 056e084069
commit 08a9f6e3f6
2 changed files with 56 additions and 1 deletions

View file

@ -7,6 +7,6 @@ La Chariotte is a web application to handle grouped orders.
- [Public server](https://chariotte.fr) - [Public server](https://chariotte.fr)
- [Online documentation](https://docs.chariotte.fr) - [Online documentation](https://docs.chariotte.fr)
This project has been initially developped and published by [Hashbang](https:// This project has been initially developed and published by [Hashbang](https://
hashbang.fr/) under an [Affero GPLv3](LICENSE) license, and is now maintained hashbang.fr/) under an [Affero GPLv3](LICENSE) license, and is now maintained
and developed by a team of volunteers. and developed by a team of volunteers.

View file

@ -50,6 +50,61 @@ en/latest/), managed by AlwaysData.
The production settings are stored in `~/ la_chariotte/prod_settings.py`, and The production settings are stored in `~/ la_chariotte/prod_settings.py`, and
the secrets are defined in the admin console. the secrets are defined in the admin console.
Here are the settings, with some comments that might be useful.
```python title="prod_settings.py"
SECRET_KEY = "YOUR SECRET KEY HERE, used to hash the passwords. CHANGE IT."
# We're connecting to a psql server, AD manages the access and the backups.
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "chariotte_prod",
"USER": "chariotte_prod",
"PASSWORD": "",
"HOST": "host",
}
}
ALLOWED_HOSTS = ["chariotte.fr",]
DEBUG = False
# We're sending mails using AD infrastructure
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_FROM = 'notification@chariotte.fr'
EMAIL_HOST = 'smtp-chariotte.alwaysdata.net'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'notification@chariotte.fr'
EMAIL_HOST_PASSWORD = "XXX"
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = os.getenv(
"DJANGO_DEFAULT_FROM_EMAIL", "La Chariotte <notification@chariotte.fr>"
)
CONTACT_MAIL = "contact@chariotte.fr"
# We're collecting the static files on this specific folder.
STATIC_ROOT = "/home/chariotte/static/"
```
We're using sentry (sentry.io) to be alerted when an error happens on the server
```python title="prod_settings.py"
import sentry_sdk
sentry_sdk.init(
dsn="PUT YOUR DSN HERE",
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)
```
### The different sites ### The different sites
In the AD console, here are the defined sites: In the AD console, here are the defined sites: