I noticed that Synology's native webstation which uses uwsgi framework, has recently added support for python script. I was wondering if someone can help me figure out a simple hello world example. I am unclear about what to put in the uwsgi file. I followed the python-flask quickstart example on uwsgi documentation page: uwsgi python-flask quickstart
On webstaion>service portal : I setup a virtual host with nginx listening on port 8080:
In this profile I then setup the appropriate folder containing the python script, callable entry function and uwsgi file:
The "main.py" python script residing in this folder is the example in the quickstart page:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return "<span style='color:red'>I am app 1</span>"
I took the command-line parameters in that example and made the uwsgi.ini file and placed it in the same folder:
[uwsgi]
socket = 127.0.0.1:8080
wsgi-file = main.py
callable = app
processes = 4
threads = 2
stats = 127.0.0.1:9191
In webstation's script>python page : I setup a "python-flask profile" and added the required flask module:
I added this "python-flask profile" in the virtual host's python profile to make sure all modules are accessible to the python script.
However, when I browse to port 8080 I get error code 500 on my browser;
Internal Server Error
I would greatly appreciate if someone could try this out on webstation to figure out the correct setup. It seems that webstation makes deploying python based web-apps quite easy so solving this issue would greatly benefit newbies like me who are looking for a quick and easy deployment method on their Synology NAS.
Thanks in advance!