cherrypy

Cherrypy_handling requests

一曲冷凌霜 提交于 2020-01-14 05:22:11
问题 I've been searching for a while now but can't find an answere. I know that cherrypy creates a new thread for handling requests (GET, PUT, POST, DELETE etc). Now i fetch the parameters like this: ... @cherrypy.tools.json_in() @cherrypy.tools.json_out() def POST(self): Forum.lock_post.acquire() conn = self.io.psqlConnect(self.dict_psql) cur = conn.cursor(cursor_factory = psycopg2.extras.RealDictCursor) params = cherrypy.request.json ... return some_dict As you can see im locking the thread to

fastcgi, cherrypy, and python

末鹿安然 提交于 2020-01-13 10:33:30
问题 So I'm trying to do more web development in python, and I've picked cherrypy, hosted by lighttpd w/ fastcgi. But my question is a very basic one: why do I need to restart lighttpd (or apache) every time I change my application code, or the code for an underlying library? I realize this question extends from a basic mis(i.e. poor)understanding of the fastcgi model, so I'm open to any schooling here, but I'm used to just changing a PHP file and it showing up, versus having to bounce the web

fastcgi, cherrypy, and python

喜夏-厌秋 提交于 2020-01-13 10:33:29
问题 So I'm trying to do more web development in python, and I've picked cherrypy, hosted by lighttpd w/ fastcgi. But my question is a very basic one: why do I need to restart lighttpd (or apache) every time I change my application code, or the code for an underlying library? I realize this question extends from a basic mis(i.e. poor)understanding of the fastcgi model, so I'm open to any schooling here, but I'm used to just changing a PHP file and it showing up, versus having to bounce the web

Socket error: Address already in use

送分小仙女□ 提交于 2020-01-11 19:42:34
问题 I have a CherryPy script that I frequently run to start a server. Today I was having to start and stop it a few times to fix some bugs in a config file, and I guess the socket didn't close all the way because when I tried to start it up again I got this issue: [23/Mar/2015:14:08:00] ENGINE Listening for SIGHUP. [23/Mar/2015:14:08:00] ENGINE Listening for SIGTERM. [23/Mar/2015:14:08:00] ENGINE Listening for SIGUSR1. [23/Mar/2015:14:08:00] ENGINE Bus STARTING CherryPy Checker: The Application

Python: deferToThread XMLRPC Server - Twisted - Cherrypy?

限于喜欢 提交于 2020-01-07 11:41:13
问题 This question is related to others I have asked on here, mainly regarding sorting huge sets of data in memory. Basically this is what I want / have: Twisted XMLRPC server running. This server keeps several (32) instances of Foo class in memory. Each Foo class contains a list bar (which will contain several million records). There is a service that retrieves data from a database, and passes it to the XMLRPC server. The data is basically a dictionary, with keys corresponding to each Foo

Python: deferToThread XMLRPC Server - Twisted - Cherrypy?

老子叫甜甜 提交于 2020-01-07 11:41:08
问题 This question is related to others I have asked on here, mainly regarding sorting huge sets of data in memory. Basically this is what I want / have: Twisted XMLRPC server running. This server keeps several (32) instances of Foo class in memory. Each Foo class contains a list bar (which will contain several million records). There is a service that retrieves data from a database, and passes it to the XMLRPC server. The data is basically a dictionary, with keys corresponding to each Foo

cherry py auto download file

[亡魂溺海] 提交于 2020-01-07 01:21:41
问题 I'm currently building cherry py app for my projects and at certain function I need auto starting download a file. After zip file finish generating, I want to start downloading to client So after images are created, they are zipped and sent to client class Process(object): exposed = True def GET(self, id, norm_all=True, format_ramp=None): ... def content(): #generating images ... def zipdir(basedir, archivename): assert os.path.isdir(basedir) with closing(ZipFile(archivename, "w", ZIP

AngularJS $http.get reports XMLHttpRequest failure

丶灬走出姿态 提交于 2020-01-06 15:18:27
问题 I'm trying to learn to use $http.get requests in AngularJS for a web app that I am writing. I have a locally hosted server that has some API that I have written. When I try to run my Angular page I can see in my server's console that the GET request has been made however nothing loads in the browser. Upon inspecting the browser's console I find this error message: XMLHttpRequest cannot load http://127.0.0.1:8080/api/range/?nmax=5&a_max=100&b_max=200, No 'Access-Control-Allow-Origin' header is

CherryPy: what is the difference between `error_page.default` vs. `error_page.404` config settings?

为君一笑 提交于 2020-01-05 04:55:21
问题 Let's say I want to display my own 404 & 500 pages, I've found 2 possibilities so far: 1: Using cherrypy.config.update def error_page_404(status, message, traceback, version): return ('Error 404 Page not found') def error_page_500(status, message, traceback, version): return ('Error:') cherrypy.config.update({'error_page.404': error_page_404, 'error_page.500': error_page_500}) Using _cp_config : from cherrypy import _cperror def handle_error(): cherrypy.response.status = 500 cherrypy.log(

cherrypy /dev/urandom (or equivalent) not found — error

本小妞迷上赌 提交于 2020-01-03 13:51:04
问题 I am running a cherrypy 3.2.0 server with Python 2.5.1, which gives the following error every few days on any instruction from UI until it is killed and re-started:- [29/Mar/2012:06:37:57] HTTP Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/CherryPy-3.2.0-py2.5.egg/cherrypy/_cprequest.py", line 636, in respond File "/usr/lib/python2.5/site-packages/CherryPy-3.2.0-py2.5.egg/cherrypy/_cprequest.py", line 97, in run File "/usr/lib/python2.5/site-packages/CherryPy-3.2.0