I have a problem with my CherryPy install on my raspberry.
When I request an function of CherryPy with ajax I have this message :
XMLHttpRequest cannot load http://my_ip:8888/takePicture. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://my_ip' is therefore not allowed access.
My python code :
import time
import os
import cherrypy
class Camera(object):
@cherrypy.expose
def takePicture(self):
os.system('fswebcam -r 1280x720 -S 3 --info Salon --jpeg 100 --save images/history/%H%M%S.jpg')
os.system('fswebcam -r 1280x720 -S 3 --info Salon --jpeg 100 --save images/last.jpg')
if __name__ == '__main__':
cherrypy.config.update({'server.socket_host': 'my_ip'})
cherrypy.config.update({'server.socket_port': 8888})
cherrypy.quickstart(Camera())
How change header response with CherryPy ?
Thanks by advance =)