Added conditional env loading.
Making it work in both dev and production without changing .env files.
This commit is contained in:
parent
fbae88eed1
commit
225ef71518
@ -1,6 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
if not os.getenv('DATA'):
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
load_dotenv('../.env')
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
APP_HOST = '0.0.0.0'
|
APP_HOST = '0.0.0.0'
|
||||||
DATA = os.getenv('DATA')
|
DATA = os.getenv('DATA')
|
||||||
|
Loading…
Reference in New Issue
Block a user