Fix deploying with gunicorn.
This commit is contained in:
parent
a6566d3fce
commit
bb4d106130
7 changed files with 14 additions and 6 deletions
4
Vagrantfile
vendored
4
Vagrantfile
vendored
|
@ -19,4 +19,8 @@ Vagrant.configure(2) do |config|
|
||||||
config.vm.provider "virtualbox" do |vb|
|
config.vm.provider "virtualbox" do |vb|
|
||||||
vb.customize ["modifyvm", :id, "--memory", "2048"]
|
vb.customize ["modifyvm", :id, "--memory", "2048"]
|
||||||
end
|
end
|
||||||
|
config.vm.provider :virtualbox do |vb|
|
||||||
|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||||
|
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
0
deploy
Executable file → Normal file
0
deploy
Executable file → Normal file
|
@ -5,5 +5,5 @@ SQLAlchemy
|
||||||
gunicorn
|
gunicorn
|
||||||
requests
|
requests
|
||||||
voluptuous
|
voluptuous
|
||||||
PIL
|
Pillow
|
||||||
markdown2
|
markdown2
|
0
scripts/setup.sh
Executable file → Normal file
0
scripts/setup.sh
Executable file → Normal file
|
@ -5,5 +5,4 @@ import problem
|
||||||
import user
|
import user
|
||||||
import stats
|
import stats
|
||||||
import team
|
import team
|
||||||
import tools
|
|
||||||
import utils
|
import utils
|
||||||
|
|
|
@ -18,6 +18,8 @@ app.config.from_object(config)
|
||||||
|
|
||||||
if not os.path.exists(app.config["UPLOAD_FOLDER"]):
|
if not os.path.exists(app.config["UPLOAD_FOLDER"]):
|
||||||
os.makedirs(app.config["UPLOAD_FOLDER"])
|
os.makedirs(app.config["UPLOAD_FOLDER"])
|
||||||
|
if not os.path.exists("pfp"):
|
||||||
|
os.makedirs("pfp")
|
||||||
|
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
from api.models import db, Files, Teams, Problems, Solves, Users
|
from api.models import db, Files, Teams, Problems, Solves, Users
|
||||||
|
@ -44,10 +46,12 @@ def api_main():
|
||||||
def page_not_found(e):
|
def page_not_found(e):
|
||||||
return send_file("../web/index.html")
|
return send_file("../web/index.html")
|
||||||
|
|
||||||
def run(args):
|
def run(args=None):
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
keyword_args = dict(args._get_kwargs())
|
try:
|
||||||
app.debug = keyword_args["debug"] if "debug" in keyword_args else False
|
keyword_args = dict(args._get_kwargs())
|
||||||
|
app.debug = keyword_args["debug"] if "debug" in keyword_args else False
|
||||||
|
except: pass
|
||||||
app.run(host="0.0.0.0", port=8000)
|
app.run(host="0.0.0.0", port=8000)
|
||||||
|
|
||||||
def load_problems(args):
|
def load_problems(args):
|
||||||
|
@ -112,4 +116,5 @@ def main():
|
||||||
else:
|
else:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
|
|
||||||
main()
|
if __name__ == "__main__":
|
||||||
|
main()
|
0
web/includes/meta.html
Executable file → Normal file
0
web/includes/meta.html
Executable file → Normal file
Loading…
Reference in a new issue