From 53e392a517bb5df8053c2271fe8db5740f725853 Mon Sep 17 00:00:00 2001 From: Dmitry Nalobin Date: Wed, 7 Oct 2020 16:45:25 +0400 Subject: [PATCH] .env.example with variables documentation (#25) --- .env.example | 6 ++++++ .gitignore | 3 ++- analytics/config.py | 2 ++ requirements.txt | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..a68f293 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +# (optional) websockets URL to connect to hastic-server +HASTIC_SERVER_URL=ws://localhost:8002 +# (optional) logging level: 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL' +HS_AN_LOGGING_LEVEL=DEBUG +# (optional) time we wait for a response from hastic/analytics before sending the error +LEARNING_TIMEOUT=120 diff --git a/.gitignore b/.gitignore index ade4385..608c810 100755 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ build/ dist/ *.spec __pycache__/ -test/ \ No newline at end of file +test/ +.env diff --git a/analytics/config.py b/analytics/config.py index 410c55b..ec91c13 100644 --- a/analytics/config.py +++ b/analytics/config.py @@ -1,6 +1,8 @@ import os import json +from dotenv import load_dotenv +load_dotenv() PARENT_FOLDER = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) CONFIG_FILE = os.path.join(PARENT_FOLDER, 'config.json') diff --git a/requirements.txt b/requirements.txt index f3bb4a1..459a958 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ numpy==1.14.5 pandas==0.20.3 pyzmq==18.0.1 scipy==1.1.0 -websockets==8.1 \ No newline at end of file +websockets==8.1 +python-dotenv==0.14.0 \ No newline at end of file