Добавил поддержку .env

This commit is contained in:
yepiwt 2021-01-03 01:23:37 +03:00
parent 68960dd75e
commit 12da4c2aab
No known key found for this signature in database
GPG Key ID: 5253B9F04F58780E

10
apps/tgbot/config.py Normal file
View File

@ -0,0 +1,10 @@
import os
from dotenv import load_dotenv
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
if os.path.exists(dotenv_path):
load_dotenv(dotenv_path)
# Loading token from .env
TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN")