Alright! Create a folder in public_html called flask /home/username/public_html/flask/
In that folder create a .htaccess file: /home/username/public_html/flask/.htaccess RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(admin_media/.*)$ - [L]
RewriteRule ^(flask\.wsgi/.*)$ - [L]
RewriteRule ^(.*)$ flask/flask.wsgi/$1 [QSA,PT,L]
Create a file named flask.wsgi import os, sys
# edit your username below
sys.path.append("/home/username/public_html/flask");
sys.path.insert(0, os.path.dirname(__file__))
from myapp import app as application
# make the secret code a little better
application.secret_key = 'secret'
Create a python script named myapp.py import sys
from flask import Flask, __version__
app = Flask(__name__)
application = app
@app.route("/")
def hello():
return """
HelioHost rules!<br><br>
<a href="/flask/python/version/">Python version</a><br>
<a href="/flask/flask/version/">Flask version</a>
"""
@app.route("/python/version/")
def p_version():
return "Python version %s" % sys.version
@app.route("/flask/version/")
def f_version():
return "Flask version %s" % __version__
if __name__ == "__main__":
app.run()
Here is the working example: https://krydos.heliohost.org/flask/ This will only work on Tommy at the moment. Feel free to play around with it and let me know if you have any issues. If everything is working I'll see about writing up a wiki and making a news post about HelioHost now supporting flask.