Skip to content

Commit

Permalink
added gunicorn webserver
Browse files Browse the repository at this point in the history
  • Loading branch information
preciserobot committed Sep 20, 2016
1 parent 9f4f20f commit 5d0854d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ zippy-install:
mkdir -p $(ZIPPYVAR)/results
chmod -R 777 $(ZIPPYVAR)

# gunicorn/nginx webserver
unicorn:
apt-get install nginx
# start gunicorn with
# gunicorn --bind 0.0.0.0:8000 wsgi:app

# webservice install (production)
webservice:
rsync -a --exclude-from=.gitignore . $(ZIPPYPATH)
Expand Down
6 changes: 6 additions & 0 deletions wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env python

from zippy import app

if __name__=="__main__":
app.run()
2 changes: 1 addition & 1 deletion zippy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def updatePrimerLocation():
print >> sys.stderr, 'Please fill in all fields (PrimerName VesselNumber Well)'
return render_template('location_updated.html', status=None)
# read config
with open(app.config['CONFIG_FILE']) as conf:
with open(app.config['CONFIG_FILE']) as conf:
config = json.load(conf, object_hook=ascii_encode_dict)
db = PrimerDB(config['database'])
# run zippy and render
Expand Down

0 comments on commit 5d0854d

Please sign in to comment.