diff --git a/requirements.txt b/requirements.txt index 4ab8053..1e8dbdd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ Flask==0.12.1 Flask-Bootstrap==3.3.7.1 Flask-Cache==0.13.1 Flask-SQLAlchemy==2.2 +gunicorn==19.7.1 itsdangerous==0.24 Jinja2==2.9.6 MarkupSafe==1.0 diff --git a/setup.py b/setup.py index 6107421..aeaea0b 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,8 @@ setup( 'flask', 'flask-bootstrap', 'flask-sqlalchemy', - 'pymysql' + 'pymysql', + "gunicorn" ], author="Denis Nutiu", author_email="denis.nutiu@gmail.com", diff --git a/src/application.py b/src/application.py index 6cebd7d..1b2a3bf 100644 --- a/src/application.py +++ b/src/application.py @@ -51,4 +51,4 @@ except (IndexError, KeyError): if __name__ == "__main__": - app.run(app.config["APP_IP"], app.config["APP_PORT"]) + app.run(app.config["BIND_IP"], app.config["BIND_PORT"]) diff --git a/src/gconfig.py b/src/gconfig.py new file mode 100644 index 0000000..4ba4946 --- /dev/null +++ b/src/gconfig.py @@ -0,0 +1,28 @@ +""" + Author: Denis Nutiu + This file is part of scoreboard-benchmark. + + scoreboard-benchmark is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + scoreboard-benchmark is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with scoreboard-benchmark . If not, see . + + This the configuration file for the GUnicorn server. +""" +from src.config import ProductionConfig +import multiprocessing + +bind = "{ip}:{port}".format(ip=ProductionConfig.BIND_IP, port=ProductionConfig.BIND_PORT) +workers = multiprocessing.cpu_count() * 2 + 1 +reload = False +#daemon = True +#user = "denis" +#group = "www-data" \ No newline at end of file