enviroment variable

Published onesixx on

environment / .env.prod

HOST=127.0.0.1
PORT=8066
DEBUG=True
DEV_TOOLS_PROPS_CHECK=True

enviroment/ setting.py

import os
from os.path import join, dirname
from dotenv import load_dotenv

dotenv_path = join(dirname(__file__), os.getenv("ENVIRONMENT_FILE", '.env.development'))
load_dotenv(dotenv_path=dotenv_path, override=True)
import os
import environment.settings

os.environ.get("PORT")
Categories: Python Basic

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x