move config to environment variables
This commit is contained in:
parent
9d6d482c91
commit
864d33486d
1 changed files with 5 additions and 7 deletions
12
app.py
12
app.py
|
@ -12,19 +12,17 @@ bcrypt = Bcrypt(app)
|
||||||
app.config['CORS_HEADERS'] = 'Content-Type'
|
app.config['CORS_HEADERS'] = 'Content-Type'
|
||||||
|
|
||||||
# ! Environment Variable
|
# ! Environment Variable
|
||||||
# TODO change to os.getenv('CONFIGURATION')
|
# TODO export CONFIGURATION_OBJECT='configuration.config.ProductionConfig'
|
||||||
# TODO export CONFIGURATION='configuration.config.ProductionConfig'
|
app.config.from_object(os.getenv('CONFIGURATION_OBJECT'))
|
||||||
app.config.from_object('configuration.config.DevelopmentConfig')
|
|
||||||
|
|
||||||
# ! Environment Variable
|
# ! Environment Variable
|
||||||
# TODO change to os.getenv('ALLOWED_ORIGIN')
|
|
||||||
# TODO export ALLOWED_ORIGIN= whatever the react server is
|
# TODO export ALLOWED_ORIGIN= whatever the react server is
|
||||||
socketio = SocketIO(app, cors_allowed_origins="http://localhost:3000")
|
socketio = SocketIO(app, cors_allowed_origins=os.getenv('ALLOWED_ORIGIN'))
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
CORS(app, resources={
|
CORS(app, resources={
|
||||||
r"/api/*": {"origins": "http://localhost:3000"},
|
r"/api/*": {"origins": os.getenv('ALLOWED_ORIGIN')},
|
||||||
r"/auth/*": {"origins": "http://localhost:3000"},
|
r"/auth/*": {"origins": os.getenv('ALLOWED_ORIGIN')},
|
||||||
})
|
})
|
||||||
db.init_app(app)
|
db.init_app(app)
|
||||||
ma.init_app(app)
|
ma.init_app(app)
|
||||||
|
|
Loading…
Reference in a new issue