Skip to content
/ SAKE Public
forked from capstone-mgh/SAKE

Source code for the SAKE segmentation framework based on the OHIF Viewer

Notifications You must be signed in to change notification settings

devhliu/SAKE

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAKE

Server side code

Deploying a Flask app to the gcloud server

(adapted from http://csparpa.github.io/blog/2013/03/how-to-deploy-flask-applications-to-apache-webserver.html)

Change user to root (or sudo all the following commands)

sudo su

Change to app directory

cd /opt/bitnami/apps/flask

Create a folder for your app

mkdir foldername

Add your app (py and wsgi file, see test app for example)

#test.py
from flask import Flask, request
app = Flask(__name__)

@app.route('/hello')
def hello_world():
  name = request.args.get('name','')
  return 'Hello ' + name + '!'

if __name__ == '__main__':
  app.run()
#test.wsgi
import sys

#Expand Python classes path with your app's path
sys.path.insert(0, "/opt/bitnami/apps/flask/test")

from test import app
application = app

Edit the bottom of the httpd.conf configuration file to give access permission to your directory and point your url

vim /opt/bitnami/apache2/conf/httpd.conf
<Directory /opt/bitnami/apps/flask/test>
  Require all granted
</Directory>
WSGIScriptAlias /flasktest /opt/bitnami/apps/flask/test/test.wsgi

Restart the Apache server

/opt/bitnami/ctlscript.sh restart apache

Useful Commands

To refresh cache after updating Flask app

rm *pyc; /opt/bitnami/ctlscript.sh restart apache

To tail server logs (requests and python print statements)

tail -f /opt/bitnami/apache2/logs/*log

About

Source code for the SAKE segmentation framework based on the OHIF Viewer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.6%
  • C 3.3%
  • Other 0.1%