Skip to content

Commit

Permalink
[ENV] Add dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Herklos committed Oct 28, 2022
1 parent 6e1aa0f commit 4e4ab5c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .env

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ logs

# Debug
cython_debug/

# dev env
.env
5 changes: 5 additions & 0 deletions octobot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# License along with OctoBot. If not, see <https://www.gnu.org/licenses/>.
import os
import pathlib
import dotenv

import octobot_commons.os_util as os_util
import octobot_commons.enums
import octobot.enums
Expand All @@ -28,6 +30,9 @@
VERSION = f"{SHORT_VERSION}{VERSION_DEV_PHASE}{VERSION_PHASE}"
LONG_VERSION = f"{SHORT_VERSION}{PATCH_VERSION}{VERSION_DEV_PHASE}{VERSION_PHASE}"

# load environment variables from .env file if exists
dotenv.load_dotenv(verbose=False)

# OctoBot urls
OCTOBOT_WEBSITE_URL = os.getenv("OCTOBOT_ONLINE_URL", "https://www.octobot.online")
OCTOBOT_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://www.octobot.info")
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ yarl==1.7.2
idna<2.9,>=2.5
requests==2.25.1
packaging==21.3
python-dotenv==0.21.0

# Community
websockets
Expand Down

0 comments on commit 4e4ab5c

Please sign in to comment.