Skip to content

Commit 845c841

Browse files
author
Andrew Mickael
committed
Automatically set working directory to project root
1 parent 439a2c9 commit 845c841

File tree

1 file changed

+4
-0
lines changed
  • create_flask_service/template

1 file changed

+4
-0
lines changed

create_flask_service/template/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
from flask_sqlalchemy import SQLAlchemy
77
from werkzeug.middleware.proxy_fix import ProxyFix
88

9+
# Set working directory to project root
10+
os.chdir(os.path.abspath(os.path.dirname(__file__)))
11+
912
# If available, load environment variables from .env before rest of the package
1013
if os.path.isfile(".env"):
1114
from dotenv import load_dotenv
@@ -14,6 +17,7 @@
1417

1518
from controller import api
1619

20+
1721
########################################################################################################################
1822
# Setup / Configuration
1923
########################################################################################################################

0 commit comments

Comments
 (0)