diff --git a/manage.py b/manage.py index f1fec81f..56a04de8 100755 --- a/manage.py +++ b/manage.py @@ -4,6 +4,7 @@ from tracpro import load_env + load_env.load_env() if __name__ == "__main__": diff --git a/tracpro/celery.py b/tracpro/celery.py index 078ab362..80c0e45f 100644 --- a/tracpro/celery.py +++ b/tracpro/celery.py @@ -7,6 +7,7 @@ from . import load_env + load_env.load_env() # set the default Django settings module for the 'celery' program. diff --git a/tracpro/load_env.py b/tracpro/load_env.py index e4dbb0bc..e25b6991 100644 --- a/tracpro/load_env.py +++ b/tracpro/load_env.py @@ -1,8 +1,9 @@ from os.path import dirname, join + import dotenv def load_env(): - "Get the path to the .env file and load it." + """Get the path to the .env file and load it.""" project_dir = dirname(dirname(__file__)) dotenv.read_dotenv(join(project_dir, '.env')) diff --git a/tracpro/wsgi.py b/tracpro/wsgi.py index 4b089548..34581f85 100644 --- a/tracpro/wsgi.py +++ b/tracpro/wsgi.py @@ -2,6 +2,7 @@ from . import load_env + load_env.load_env() os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tracpro.settings")