diff --git a/deploy b/deploy index 4789c79..fc3edc2 100755 --- a/deploy +++ b/deploy @@ -7,4 +7,4 @@ sudo service nginx stop echo "Starting the server..." cd /home/vagrant/server sudo service nginx start -gunicorn --bind 0.0.0.0:8000 -w 1 "app:app" \ No newline at end of file +gunicorn "app:app" -c /home/vagrant/scripts/gunicorn.py.ini diff --git a/scripts/gunicorn.py.ini b/scripts/gunicorn.py.ini new file mode 100644 index 0000000..d8cdb2c --- /dev/null +++ b/scripts/gunicorn.py.ini @@ -0,0 +1,4 @@ +from multiprocessing import cpu_count + +bind = "0.0.0.0:8000" +workers = cpu_count() * 2 + 1 diff --git a/server/api/__init__.py b/server/api/__init__.py index 5b42b9b..2c4eac3 100644 --- a/server/api/__init__.py +++ b/server/api/__init__.py @@ -1 +1 @@ -import api.models \ No newline at end of file +import models \ No newline at end of file diff --git a/server/app.py b/server/app.py index 4478f59..197d279 100644 --- a/server/app.py +++ b/server/app.py @@ -3,9 +3,6 @@ from flask import Flask import config import json -import sys - -from flask import Flask app = Flask(__name__) app.secret_key = config.SECRET