Adding GUNICORN support

This commit is contained in:
Denis-Cosmin Nutiu 2017-04-21 16:59:33 +03:00
parent d94c512ae9
commit 016658f2a6
4 changed files with 32 additions and 2 deletions

View file

@ -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

View file

@ -28,7 +28,8 @@ setup(
'flask',
'flask-bootstrap',
'flask-sqlalchemy',
'pymysql'
'pymysql',
"gunicorn"
],
author="Denis Nutiu",
author_email="denis.nutiu@gmail.com",

View file

@ -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"])

28
src/gconfig.py Normal file
View file

@ -0,0 +1,28 @@
"""
Author: Denis Nutiu <denis.nutiu@gmail.com>
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 <http://www.gnu.org/licenses/>.
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"