This machine is dedicated to running python flask applications written by students.
Each student can run one flask application under uwsgi.
The python code must be in ~/html/flask/server.py
The service appears at the address http://40000036.set09603.napier.ac.uk
For debugging you can run the server directly on any port between 5000 and 5999 - you must use a port that no other student is using. Please use 5036 where 036 are the last three digits of your matriculation number
In the following instructions, 40000036 should be replaced by your matriculation number
from flask import Flask app = Flask(__name__) @app.route('/') def index(): return "Hello world" if __name__=='__main__': app.run(host='0.0.0.0',port=5036,debug=True)
Internal Server Error
ls ~/html/flask
you should see several files and folders, one should be called server.py
cd ~/html/flask rm -rf .git * git clone git@gitgud.napier.ac.uk:40000036/mmworld.git .NOTICE THE . at the end of the last command!
app.run
is wrongif __name__ == '__main__': app.run(host='0.0.0.0',port=5036,debug=True)If you have just
app.run(host='0.0.0.0',port=5036,debug=True)it will not work.
python server.py