Adding IP and PORT as config settings

This commit is contained in:
Denis-Cosmin Nutiu 2017-04-18 01:35:05 +03:00
parent 49d85b181d
commit 32dcd5596a
2 changed files with 10 additions and 1 deletions

View file

@ -49,4 +49,4 @@ except (IndexError, KeyError):
if __name__ == "__main__": if __name__ == "__main__":
app.run("0.0.0.0") app.run(app.config["APP_IP"], app.config["APP_PORT"])

View file

@ -21,8 +21,17 @@ from src.models import db
basedir = os.path.abspath(os.path.dirname(__file__)) basedir = os.path.abspath(os.path.dirname(__file__))
class Config: class Config:
"""
This class contains general configuration settings that are available everywhere.
You may edit this class and the ProductionConfig class if you wish to deploy.
"""
SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_COMMIT_ON_TEARDOWN = True
# Url Settings
APP_IP = "0.0.0.0"
APP_PORT = 5000
# Pagination
MAX_RESULTS_PER_PAGE = 10
@staticmethod @staticmethod
def init_app(app): def init_app(app):