SET09603 student server

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

To log in

Create a python flask app

Troubleshooting the error Internal Server Error

Here are the most common problems:
You do not have a file called ~/html/flask/server.py
It could be that your project clone was wrong.
Test using ls ~/html/flask you should see several files and folders, one should be called server.py
To fix follow these steps:
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 wrong
The final lines of server.py should look like this
if __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.
You have a compile time problem with your python
Try running the server from the command line:
python server.py