Good morning.
As the title indicates, I've got some questions about using python for web development.
What is the best setup for a development environment, more specifically, what webserver to use, how to bind python with it. Preferably, I'd like it to be implementable in both, *nix and win environment.
My major concern when I last ...
I'm developing a CherryPy FastCGI server behind lighttpd with the following setup to enable using ORM SQLAlchemy sessions inside CherryPy controllers. However, when I run stress tests with 14 concurrent requests for about 500 loops, it starts to give errors like AttributeError: '_ThreadData' object has no attribute 'scoped_session_class'...
I am somewhat new to transactional databases and have come across an issue I am trying to understand.
I have created a simple demonstration where a database connection is stored inside each of the 5 threads created by cherrypy. I have a method that displays a table of timestamps stored in the database and a button to add a new record...
Hi guys,
I've followed the tutorials for setting up Apache with mod_wsgi to interface cherrypy and make a site running of it. This is my "myapp.wsgi", and opening http://localhost/ works great. Opening http://localhost/ape/ actually returns the text instead of a soap-response, and http://localhost/ape/service.wsdl returns a 500 HTTP erro...
In PHP I would do it like this:
session_name("special_session_name");
So how do I do it with Cherrypy?
Just need to find exact equivalent for it.
PHP manual page:
http://fi2.php.net/session_name
...
Hello. Is it any easy way to use cherrypy as an web server that will display .html files in some folder? All cherrypy introductory documentation states that content is dynamically generated:
import cherrypy
class HelloWorld(object):
def index(self):
return "Hello World!"
index.exposed = True
cherrypy.quickstart(HelloWorl...
When I am running CherryPy Hello World:
import cherrypy
class HelloWorld:
def index(self):
return "Hello world!"
index.exposed = True
cherrypy.config.update({'server.socket_port': 8080,})
cherrypy.quickstart(HelloWorld())
... I get this: IOError: Port 8080 not bound on 'localhost'. What could it be?
...
In cherrypy.lib.static.py there is a method:
serve_file(path, content_type=None, disposition=None, name=None)
where the argument "path" must be a real file (absolute path). Is there something similar to serve any Python file object?
...
I have a linux based web hosting provider (fatcow.com) that doesn't give any command line access and won't run the setup script for CherryPy (python web server) for me.
Is there any way to run get around this limitation so that I have a working install of CherryPy?
This might be more or a serverfault.com question, but maybe someone her...
I'm in the process of building a web application using cherrypy.
What template technology do you recommend I use?
...
When you start/stop a python cherrypy service (compiled with py2exe), this works fine When I get a sys.exit() call (from my error handler), cherrypy quits, but the service remains hanging.
Code:
import cherrypy
import win32serviceutil
import win32service
import sys
SERVICE = None
class HelloWorld:
""" Sample request handler clas...
It is a rather strange 'bug'.
I have written a cherrypy based server. If I run it this way:
python simple_server.py > out.txt
It works as expected.
Without the the redirection at the end, however, the server will not accept any connection at all.
Anyone has any idea?
I am using python 2.4 on a Win XP professional machine.
...
I've got an application that runs Twisted by starting the reactor with reactor.run() in my main thread after starting some other threads, including the CherryPy web server. Here's a program that shuts down cleanly when Ctrl+C is pressed on Linux but not on Windows:
from threading import Thread
from signal import signal, SIGINT
import ...
Let's say I have some code (using CherryPy) that looks like this:
import cherrypy
class Names:
def index(self, name=None):
return "Names.index: " + str(name)
index.exposed = True
class Root:
def index(self):
return "This is the root"
index.exposed = True
if __name__ == "__main__":
root = Root()
...
It's not the same to POST to an URL than to GET it, DELETE it or PUT it. These actions are fundamentally different. However, Django seems to ignore them in its dispatch mechanism. Basically, one is forced to either ignore HTTP verbs completely or do this on every view:
def my_view(request, arg1, arg2):
if request.method == 'GET':
...
Hi,
Context:
Imagine that you have a standard CherryPy hello word app:
def index(self):
return "Hello world!"
index.exposed = True
and you would like to do some post-processing, i.e. record request processing or just log the fact that we were called from specific IP. What you would do is probably:
def index(self):
sel...
Hey, any idea about what is the timeout error which I am getting here:
Error trace:
File "/array/purato/python2.6/lib/python2.6/site-packages/cherrypy/_cprequest.py", line 606, in respond
cherrypy.response.body = self.handler() ...
I've followed the basic CherryPy tutorial (http://www.cherrypy.org/wiki/CherryPyTutorial). One thing not discussed is deployment.
How can I launch a CherryPy app as a daemon and "forget about it"? What happens if the server reboots?
Is there a standard recipe? Maybe something that will create a service script (/etc/init.d/cherrypy.....
I am developing on cherrypy, I start it from a python script.
For better development I wonder what is the correct way to stop cherrypy from within the main process (and not from the outside with ctrl-c or SIGTERM).
I assume I have to register a callback function from the main application to be able to stop the cherrypy main process fro...
Is it possible to use the CherrPy server as a blocking/non-threading server (for easier debugging?)
...