Skip to content
This repository has been archived by the owner on Jul 21, 2019. It is now read-only.

Commit

Permalink
Attempt to fix 404s in production
Browse files Browse the repository at this point in the history
  • Loading branch information
textbook committed Mar 11, 2016
1 parent dbffca6 commit 561b5c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions flask_forecaster/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class Config(object):

DEBUG = False
SECRET_KEY = 'youwillneverguessme'
SERVER_NAME = 'localhost:5000'
SERVER_BASE = 'localhost'
SERVER_PORT = '5000'
SQLALCHEMY_DATABASE_URI = 'postgresql://postgres@localhost/flask_test'
SQLALCHEMY_TRACK_MODIFICATIONS = False
TESTING = False
Expand Down Expand Up @@ -55,7 +56,8 @@ def for_current_env(cls, env_var='FLASK_CONFIG', default='prod'):
(0, 'credentials', 'uri'),
),
SECRET_KEY=_require('FLASK_SECRET_KEY'),
SERVER_NAME='0.0.0.0:{}'.format(_require('PORT')),
SERVER_BASE='0.0.0.0',
SERVER_PORT=_require('PORT'),
)
elif env == 'test':
config_vars = dict(
Expand Down
2 changes: 1 addition & 1 deletion scripts/launch_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@

if __name__ == '__main__':
from flask_forecaster import app
host, port = app.config['SERVER_NAME'].split(':')
host, port = app.config['SERVER_BASE'], app.config['SERVER_PORT']
logger.info('starting app on %s, %s', host, port)
app.run(host=host, port=int(port))

0 comments on commit 561b5c3

Please sign in to comment.