It's a great guide.titanicsaled wrote:Hello again everyone. Just to say, my SD card arrived yesterday and I've completed the tutorial. It's live on my blog right now,http://rstreefland.com.
I hope it's useful to those who are interested!
Not sure what settings need to be changed from the top of my head. I'll give it a go myself and then post a quick guide.meglome wrote:If I wanted to use https with this would there be any issues?
I'd be looking to use a self-signed cert. Thankstitanicsaled wrote: Not sure what settings need to be changed from the top of my head. I'll give it a go myself and then post a quick guide.
Are you looking to set up self signed or a verified SSL cert?
Code: Select all
import sys from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello Python World!' @app.route('/proc/<path>') def cpuinfo(path): try: path = path.replace("/","") with open('/proc/'+path) as f: a = "<html><body>" for line in f: a += line + "<br/>" a += "</body></html>" except Exception as e: a = "Unexpected error: " + str(e) except: a = "other exception" return a @app.route('/test') def test(): return '<http><body>this is a test<br/>so is this</body></http>' if __name__ == '__main__': app.run()
I followed the instructions here: http://www.collectivedisorder.com/ubuntuhttp://myraspi/proc/cpuinfo wrote: Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 464.48
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
Hardware : BCM2708
Revision : 0002
Serial : 000000005cc9e5c9