Skip to content

Commit

Permalink
Added Variable Environment Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
dyohan9 committed Nov 25, 2019
1 parent 3c4269b commit b46b61b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ You can set environment variables in your OS, write on ```.env``` file or pass v
| BOTHUB_BOT_NICKNAME | ```string``` | ```bot_repository``` | Nickname that the system will use to create the account
| BOTHUB_ENGINE_USE_SENTRY | ```bool``` | ```False``` | Enable Support Sentry
| BOTHUB_ENGINE_SENTRY | ```string``` | ```None``` | URL Sentry
| ENVIRONMENT | ```string``` | ```production``` |
5 changes: 4 additions & 1 deletion bothub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

env = environ.Env(
# set casting, default value
ENVIRONMENT=(str, "production"),
DEBUG=(bool, False),
ALLOWED_HOSTS=(lambda v: [s.strip() for s in v.split(",")], "*"),
LANGUAGE_CODE=(str, "en-us"),
Expand Down Expand Up @@ -321,5 +322,7 @@

if BOTHUB_ENGINE_USE_SENTRY:
sentry_sdk.init(
dsn=env.str("BOTHUB_ENGINE_SENTRY"), integrations=[DjangoIntegration()]
dsn=env.str("BOTHUB_ENGINE_SENTRY"),
integrations=[DjangoIntegration()],
environment=env.str("ENVIRONMENT"),
)

0 comments on commit b46b61b

Please sign in to comment.