Using flask on Raspberry Pi - https://towardsdatascience. com/python-webserver-with- flask-and-raspberry-pi- 398423cc6f5d
Also, it is apt install supervisor, and not apt install supervisord.
sudo apt install supervisor
looks like /etc has a supervisor directory and a conf.d directory inside it!
sudo service supervisor status
not supervisord
Also, supervisor seems to search for and use supervisord.conf files, so we must ensure wrong or backup files are renamed to something else.
INFO exited: flask_app (exit status 1; not expected
This was apparently due to not using the user=ouruser in the config file.
Final configuration was just by appending the following to the existing /etc/supervisor/supervisord.conf file.
[program:flask_app]
user = ouruser
command = /usr/bin/python ourapp.py
directory = /home/our/path/to/WebServer
autostart = true
autorestart = true
user = ouruser
command = /usr/bin/python ourapp.py
directory = /home/our/path/to/WebServer
autostart = true
autorestart = true
Then, to add a favicon, we need to add a route:
Authentication, or running on android -
https://www.digitalocean.com/community/tutorials/how-to- add-authentication-to-your- app-with-flask-login
UFW and limit ip address would be easier.
(Had to install python-is-python3 on one of my systems for using python nameof script.py instead of python3 nameofscript.py)
Edit: problems with this approach, and alternate solution in another post.
No comments:
Post a Comment