简体   繁体   中英

Raspberry Pi running Flask locally for iPad

I need to run a flask app on my Raspberry Pi locally. I'm planning on putting it in my car where I will have no internet connection. This doesn't matter as I only need it to run one website that I will write in python using the flask framework.

I have setup a wifi adapter to work as an access point that I can connect to my raspberry pi with.

I'm good with python and flask development, and am very comfortable in a linux style terminal - but I am having trouble finding a way to run a flask app on my Pi that I can access over the Pi's network on an iPad. Do I need to deploy it somehow?

This is how I'm running a network from the Pi: http://www.daveconroy.com/turn-your-raspberry-pi-into-a-wifi-hotspot-with-edimax-nano-usb-ew-7811un-rtl8188cus-chipset/

As of now that allows me to use an iPad to connect to the Pi's network. If I write a small sample app in Flask and run a server from the terminal I can connect to it by entering the Pi's IP address in the iPad's browser. However, when I pull the ethernet plug from the Pi - thus killing it's internet connection) I can no longer load the Flask site on my iPad. I can still connect to the wifi network, but I can't view the flask app.

Any ideas?

I ended up using gunicorn to host flask running on nginx. Details here: Deploy Flask on Raspberry Pi with Nginx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM