This commit is contained in:
ksenia_mikhailova 2025-06-24 15:37:25 +03:00
parent 76c8166982
commit 875103603c
2 changed files with 13 additions and 1 deletions

View File

@ -1,6 +1,18 @@
import os import os
import sys
from dotenv import load_dotenv from dotenv import load_dotenv
load_dotenv() def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
# Загружаем .env из правильного места
env_path = resource_path('.env')
load_dotenv(dotenv_path=env_path)
MAIN_URL = os.getenv("MAIN_URL", "https://example.com") MAIN_URL = os.getenv("MAIN_URL", "https://example.com")

BIN
dist/main.exe vendored

Binary file not shown.