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
17
votes
2 answers

Friendly URL for a REST WebService with CherryPy

I'm making a RESTful WebService using CherryPy 3 but I encounter a problem : I want to be able to answer requests like : /customers/1/products/386 meaning I want all the product with ID 386 of the client with ID 1. So I try to make it with the…
Yohan D
  • 930
  • 2
  • 7
  • 24
16
votes
2 answers

How can I force cherrypy to accept a variable number of GET parameters?

for instance, say I have my cherrypy index module set up like this >>> import cherrypy >>> class test: def index(self, var = None): if var: print var else: print "nothing" …
tehryan
  • 757
  • 3
  • 8
  • 14
14
votes
2 answers

CherryPy with additional threads for custom jobs

We're designing a system based on CherryPy that in addition to serving web requests needs to do tasks/jobs in parallel. We want it to be a single process running as a daemon and create threads for all the parallel jobs like scheduled tasks or…
Chrizmo
  • 626
  • 2
  • 7
  • 18
13
votes
10 answers

CherryPy Hello World error

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…
Alex
  • 43,191
  • 44
  • 96
  • 127
13
votes
4 answers

data validation for SQLAlchemy declarative models

I'm using CherryPy, Mako templates, and SQLAlchemy in a web app. I'm coming from a Ruby on Rails background and I'm trying to set up some data validation for my models. I can't figure out the best way to ensure, say, a 'name' field has a value…
Sarah Vessels
  • 30,930
  • 33
  • 155
  • 222
13
votes
5 answers

CherryPy and RESTful web api

What's the best approach of creating a RESTful web api in CherryPy? I've been looking around for a few days now and nothing seems great. For Django it seems that are lots of tools to do this, but not for CherryPy or I am not aware of them. Later…
hyperboreean
  • 8,273
  • 12
  • 61
  • 97
13
votes
2 answers

Is CherryPy a robust webserver (ie, is it reliable under a huge load like Apache)?

I'm wondering because CherryPy is, from my knowledge, built purely in Python, which is obviously slower than C et al. Does this mean that it's only good for dev / testing environments, or could I use it behind NGINX like I use Apache with Fast CGI…
orokusaki
  • 55,146
  • 59
  • 179
  • 257
12
votes
4 answers

How to get CherryPy version

I'm very new to CherryPy. I want to know which CherryPy version is installed in my machine. How to get CherryPy version in terminal? Thank you for educate me.
Zeck
  • 6,433
  • 21
  • 71
  • 111
12
votes
5 answers

Python web programming

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…
Karolis
  • 879
  • 1
  • 9
  • 20
12
votes
2 answers

Dynamic URL with CherryPY MethodDispatcher

I need to configure a RESTful style URL that support the following URL scheme: /parent/ /parent/1 /parent/1/children /parent/1/chidren/1 I want to use the MethodDispatcher so that each of the above can have GET/POST/PUT/DELETE functions. I…
Shawn Swaner
  • 10,818
  • 1
  • 21
  • 14
12
votes
3 answers

Unittesting cherrypy webapp

I recently had to rewrite our rest api, and made the switch from Flask to Cherrypy (mostly due to Python 3 compatibility). But now I'm stuck trying to write my unit tests, Flask has a really nifty built-in test client, that you can use to sent fake…
Blubber
  • 2,214
  • 1
  • 17
  • 26
12
votes
4 answers

Why don't Django and CherryPy support HTTP verb-based dispatch natively?

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…
Martin Blech
  • 13,135
  • 6
  • 31
  • 35
12
votes
2 answers

bottle on cherrypy server + ssl

I am trying to run Bottle on top of Cherrypy's server. I want to get SSL Support. So far I have tried this: from bottle import Bottle, route from cherrypy import wsgiserver app = Bottle() @app.route("/") def index(): return "Hello" server =…
zyash
  • 722
  • 6
  • 24
11
votes
6 answers

Which template technology should I use with CherryPy?

I'm in the process of building a web application using cherrypy. What template technology do you recommend I use?
Ben Noland
  • 34,230
  • 18
  • 50
  • 51
11
votes
2 answers

Change Cherrypy Port and restart web server

Is there a way in python to change the port that cherrypy is using and force the web server (not apache, cherrypy) to restart?
William Troup
  • 12,739
  • 21
  • 70
  • 98
1
2
3
91 92