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
1 answer

CherryPy Logging: How do I configure and use the global and application level loggers?

I'm having trouble with logging. I'm running CherryPy 3.2 and I've been reading through the docs here, but haven't found any examples of how to configure a local log file for output and how to write to it. Raspberry.py: import socket import…
bitcycle
  • 7,632
  • 16
  • 70
  • 121
6
votes
2 answers

CherryPy combine file and dictionary based configuration

I'm setting up a CherryPy application and would like to have the majority of my configuration settings in a .conf file like this: [global] server.socketPort = 8080 server.threadPool = 10 server.environment = "production" However I would also like…
jamesaharvey
  • 14,023
  • 15
  • 52
  • 63
6
votes
1 answer

URL Builder for CherryPy

After using werkzeug as a web framework (which is great and simple, but doesnt support some features), i'm now trying cherrypy. Now what I miss in cherrypy is werkzeug's elegant way of building urls (e.g. for links in templates) using the name of a…
tautologe
  • 1,781
  • 2
  • 15
  • 14
6
votes
3 answers

How to run the CherryPy web server in the Google App Engine

The CherryPy web server can supposedly be deployed in the Google App Engine. Who has done it, and what was the experience like? What special effort was required (configuration, etc.)? Would you recommend it to others?
Rob Williams
  • 7,919
  • 1
  • 35
  • 42
6
votes
5 answers

Selecting a Python Web Framework

This may seem like a subjective question. But it is not (that's not the idea, at least). I'm developing an Advertising software (like AdWords, AdBrite, etc) and i've decide to use Python. And would like to use one of those well known web frameworks…
santiagobasulto
  • 11,320
  • 11
  • 64
  • 88
6
votes
2 answers

How can I use multiple databases in the same request in Cherrypy and SQLAlchemy?

My app connects to multiple databases using a technique similar to this. It works so long as I don't try to access different databases in the same request. Having looked back to the above script I see they have written a comment to this…
OrganicPanda
  • 2,667
  • 1
  • 27
  • 28
6
votes
1 answer

How to disable SSL3 and weak ciphers with cherrypy builtin ssl module (python 3)

I have configured Cherrypy 3.8.0 with Python 3 to use SSL/TLS. However, I want to disable SSL3 to avoid POODLE. I searched through the documentation but I am unsure on how to implement it. I am using the cherrypy/python builtin ssl module, not…
gc5
  • 9,468
  • 24
  • 90
  • 151
6
votes
2 answers

Writing a CherryPy Decorator for Authorization

I have a cherrypy application and on some of the views I want to start only allowing certain users to view them, and sending anyone else to an authorization required page. Is there a way I can do this with a custom decorator? I think that would be…
Greg
  • 45,306
  • 89
  • 231
  • 297
6
votes
1 answer

Cherrypy multithreading example

I do know that cherrypy is a multithreaded and also has a threadpool implementation. So I wanted to try an example showing multithreaded behaviour. Now lets say I've my some function in the root class and rest all things are configured def…
Prahlad
  • 364
  • 3
  • 6
6
votes
4 answers

Is it possible to debug CherryPy applications?

I've seen this question posted here before but I want to get a final yes/no on this. I've been trying to debug my app using Netbeans 6.8 (no luck at all) and the newly released Netbeans 6.9 (notices that code has been called but fails to stop the…
OrganicPanda
  • 2,667
  • 1
  • 27
  • 28
6
votes
2 answers

415 exception Cherrypy webservice

I'm trying to build a Cherrypy/Python webservice. I already spend the whole day on finding out how to make a cross domain ajax request possible. That's finally working, but now I have the next issue. I think I already know the solution, but I don't…
Chris
  • 73
  • 1
  • 5
6
votes
2 answers

stopping a cherrypy server over http

I have a cherrypy app that I'm controlling over http with a wxpython ui. I want to kill the server when the ui closes, but I don't know how to do that. Right now I'm just doing a sys.exit() on the window close event but thats resulting in Traceback…
d.c
  • 243
  • 3
  • 6
6
votes
8 answers

How to catch all exceptions with CherryPy?

I use CherryPy to run a very simple web server. It is intended to process the GET parameters and, if they are correct, do something with them. import cherrypy class MainServer(object): def index(self, **params): # do things with correct…
WoJ
  • 27,165
  • 48
  • 180
  • 345
6
votes
3 answers

Python Cherrypy: 500 ValueError: Page handlers MUST return bytes

I'm getting the following error from my cherrypy script that is being generated by the submit module. ValueError: Page handlers MUST return bytes. Use tools.encode if you wish to return unicode I turned tool.encode on in my config but I'm still…
natsuki_2002
  • 24,239
  • 21
  • 46
  • 50
6
votes
2 answers

Apache sockets not closing?

I have a web application written using CherryPy, which is run locally on 127.0.0.1:4321. We use mod-rewrite and mod-proxy to have Apache act as a reverse proxy; Apache also handles our SSL encryption and may eventually be used to transfer all of…
Eli Courtwright
  • 186,300
  • 67
  • 213
  • 256