Questions tagged [cherrypy]

CherryPy is a pythonic, object-oriented HTTP framework. See cherrypy.dev for more information. Ask for interactive help @ https://gitter.im/cherrypy/cherrypy

CherryPy is a pythonic, object-oriented HTTP framework.

Features

  • A HTTP/1.1-compliant, WSGI thread-pooled webserver. Typically, CherryPy itself takes only 1-2 ms per page.
  • Support for any other WSGI-enabled web server or adapter, including Apache, IIS, lighttpd, mod_python, FastCGI, SCGI, and mod_wsgi.
  • A native mod_python adapter.
  • Multiple HTTP servers (e.g. on multiple ports) at once.
  • A plugin system. CherryPy plugins hook into events within the server process — into server startup, server shutdown, server exiting, etc. — to run code that needs to be run when the server starts up or shuts down.
  • Built-in tools for caching, encoding, sessions, authorization, static content, and others. CherryPy tools hook into events within the request process. Whenever the CherryPy server receives a request, there is a specific set of steps it goes through to handle that request. Page handlers are only one step in the process. Tools also provide a syntax and configuration API for turning them on and off for a specific set of handlers.
  • A configuration system for developers and deployers. CherryPy deployments are configurable on site, on application and on controller level, through Python dictionaries, configuration files, and open file objects.
  • Every component is swappable and customizable.
  • A complete test suite:
    • tests for both basic and advanced functionality
    • command-line options to control which tests are run, and the output they produce
    • debugging tools specifically for web page tests
    • many of the test suite components are reusable by applications.
  • Built-in profiling since v2.1, coverage and testing support.
1372 questions
6
votes
2 answers

pylibmc: 'Assertion "ptr->query_id == query_id +1" failed for function "memcached_get_by_key"'

I have a python web app that uses the pylibmc module to connect to a memcached server. If I test my app with requests once per second or slower, everything works fine. If I send more than one request per second, however, my app crashes and I see the…
culix
  • 10,188
  • 6
  • 36
  • 52
6
votes
1 answer

Can Flask provide CherryPy style routing?

The default CherryPy routing style is based on instances of classes with methods decorated by @cherrypy.expose. In the example below, these urls are provided by simple tweaking on otherwise ordinary classes. / /hello /hello/again /bye /bye/again I…
Xuan
  • 5,255
  • 1
  • 34
  • 30
5
votes
2 answers

Cherrypy returning NotFound: (404, "The path '/' was not found.")

I am new to cherrypy and am trying to mount a simple hello world application but it keeps returning "NotFound: (404, "The path '/' was not found.")", but I have defined it. Here's what I got, In the __init__.py import cherrypy from HomeNetMain…
mitchellsg
  • 486
  • 5
  • 13
5
votes
1 answer

How to read data out of a SQLite database, into a dictionary before encoding it in JSON?

I am a beginner at python and using SQLite. So please be patient with me. I am not entirely sure how much information i should provide, so i have decided on putting up as much code as i think is related. Like the saying goes; better safe than sorry.…
davidx1
  • 3,525
  • 9
  • 38
  • 65
5
votes
3 answers

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

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…
haltTm
  • 534
  • 1
  • 6
  • 25
5
votes
1 answer

Is the routes Dispatcher broken in CherryPy for Mac?

Is CherryPy broken? I just set it up and tried to use the routes dispatcher but it has an import error, my code is as follows: import cherrypy mapper = cherrypy.dispatch.RoutesDispatcher() The error is: Traceback (most recent call last): File…
jwesonga
  • 4,249
  • 16
  • 56
  • 83
5
votes
1 answer

Cherrypy server winding up on too many requests

I was using a cherrypy based server on AWS to handle some REST API calls. But on deploying the server and with some serious traffic (around 200,000 requests within 8hours) the server wound up. The error log shows only one type of error. ENGINE…
Codevalley
  • 4,593
  • 7
  • 42
  • 56
5
votes
1 answer

cherrypy.request.body.read() error

I'm having some problems accessing http requests' bodies with the CherryPy framework. I'm using CherryPy 3.2.0 on a x86_64 Arch Linux machine w/ Python3 and Aptana Web Studio IDE. When I try to access a request's body via the usual…
Jacoscaz
  • 159
  • 1
  • 7
5
votes
1 answer

python web server and periodic tasks

I am using CherryPy to receive requests through REST API. Apart from handling requests the application should also do some resource management every few seconds. What is the easiest way to do this? 1) run a separate thread 2)…
johndodo
  • 17,247
  • 15
  • 96
  • 113
5
votes
3 answers

cherrypy handle all request with one function or class

i'd like to use cherrypy but i don't want to use the normal dispatcher, i'd like to have a function that catch all the requests and then perform my code. I think that i have to implement my own dispatcher but i can't find any valid example. Can you…
wezzy
  • 5,897
  • 3
  • 31
  • 42
5
votes
3 answers

python postgres cursor timestamp issue

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…
adam
  • 6,582
  • 4
  • 29
  • 28
5
votes
1 answer

How to put object in hidden input field using html and cheeypy

below is abc.html
pareshm
  • 4,874
  • 5
  • 35
  • 53
5
votes
1 answer

Getting a cherrypy Hello World running on EC2 instance

I am trying to do a simple proof of concept on a new EC2 instance in which I run the "Hello World" tutorial code from the CherryPy distribution. CherryPy launches successfully, and a wget run directly on the EC2 instance successfully retrieves the…
JTB
  • 95
  • 1
  • 5
5
votes
2 answers

Can't serve static files from cherrypy

I'm starting to learn cherrypy but I've run in to a roadblock. I can't get static files to save my life. I'm getting a 404. The path '/static' was not found. I've googled however have yet to find a solution. All I want to do is serve files at…
Kylee
  • 1,625
  • 1
  • 31
  • 54
5
votes
1 answer

Cherrypy vs. Apache/mod_wsgi

What are pros/cons? -Stability -Developer friendliness -System resources -Scalability
webnat0
  • 2,646
  • 5
  • 29
  • 43