I am trying to run a Flask app on my Synology Diskstation running DSM 7.2:
- I have setup a port-based virtual host with a Python Profile loaded with the Flask module and the backend pointed to the appropriate directory.
- I created a super stripped-down Flask app
However every time I load the app page I get the error profile sent back (and I know the virtual host is sending it because I configured a specific error profile for this app).
So I looked at:
sudo cat /volume1/@appdata/Python3.9/log/python3.9-uwsgi.log And found the following:
2024-03-30T08:21:39-04:00 thisDiskStation python3.9-uwsgi[4522]: --- no python application found, check your startup logs for errors ---
I am sure I am making a basic error. I am a newbie to WSGI and Flask. Do I need to create a wsgi.ini file in the app directory?
I would appreciate any guidance! Thank you!
Unsurprisingly it was bugs in my code:
The entry point wsgi.py file needed to add the directory path for the application. I was using the incorrect flask object in @.route
I would be more than happy to share sample DSM virtual host configuration screenshots and code files with anybody who may need them and avoid 2 days of head scratching.
HUGE thanks to: https://medium.com/@rizqinur2010/deploying-python-flask-in-synology-dsm-7-without-docker-d99f1603bc87
As an bonus, the author also provides guidance on how to log to the DSM.