We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83b0e8d commit e5b9e13Copy full SHA for e5b9e13
tfinance/config.py
@@ -7,4 +7,6 @@
7
8
9
BOT_TOKEN = os.getenv("BOT_TOKEN")
10
+DATABASE_NAME = os.getenv("DATABASE_NAME")
11
+
12
TIMEZONE = pytz.timezone("Europe/Moscow")
tfinance/database.py
@@ -1,6 +1,7 @@
1
import sqlite3
2
3
from models import User
4
+from tfinance.config import DATABASE_NAME
5
6
def singleton(cls):
@@ -22,7 +23,7 @@ class Database:
22
23
24
def __init__(self):
25
# Подключение к БД с отключенной проверкой потока.
- self.con = sqlite3.connect("data.db", check_same_thread=False)
26
+ self.con = sqlite3.connect(f"{DATABASE_NAME}.db", check_same_thread=False)
27
self.cur = self.con.cursor()
28
self.setup()
29
0 commit comments