Skip to content

Commit

Permalink
fix: env vars are handled in a .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgiolaga committed Nov 3, 2024
1 parent 00e7dcc commit e03ea8e
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea
.DS_Store
.env
__pycache__
venv
conf/local.py
1 change: 1 addition & 0 deletions conf/prod.py → conf/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os

env = os.getenv('ENV', 'local')
token = os.getenv("PB_TG_TOKEN")
hosting_url = os.getenv("PB_URL")
table_name = os.getenv("PB_DB_TABLE_NAME")
Expand Down
8 changes: 0 additions & 8 deletions conf/switch.py

This file was deleted.

2 changes: 1 addition & 1 deletion db/connection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import psycopg2
from conf.switch import host, database, user, password, port
from conf.conf import host, database, user, password, port
class Connection:
_instance = None

Expand Down
2 changes: 1 addition & 1 deletion db/queries.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from conf.switch import table_name
from conf.conf import table_name
from utils.constants import default_target, default_time, default_message
from psycopg2 import sql
from utils.utils import compute_next_wednesday
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from telegram.ext import CommandHandler, MessageHandler, Filters, Updater
from conf.switch import token, hosting_url, env
from conf.conf import token, hosting_url
from callbacks.start import start
from callbacks.stop import stop
from callbacks.set_number import set_number
Expand Down

0 comments on commit e03ea8e

Please sign in to comment.