Skip to content

Commit

Permalink
fix env module ignore by .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
wuttinanhi committed Sep 21, 2022
1 parent 7d09a25 commit 6e5a126
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions env_wrapper/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
env module
"""


def load_env():
import os

from dotenv import load_dotenv
if os.getenv("env") == "production":
load_dotenv(dotenv_path=".env")
else:
load_dotenv(dotenv_path="dev.env")
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from auth import auth_blueprint
from car import car_blueprint
from database.database import db_session, init_db
from env import load_env
from env_wrapper import load_env
from parking_lot import parking_lot_blueprint

# load env
Expand Down
2 changes: 1 addition & 1 deletion mock/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

if __name__ == "__main__":
from env import load_env
from env_wrapper import load_env
load_env()
from mock.mock import Mock
Mock.clean_db()
Expand Down

0 comments on commit 6e5a126

Please sign in to comment.