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

running cherrypy application on gevent wsgi server

I have an existing cherrypy application but I want to know is if it's at all possible to run it on the gevent wsgi server. I imagine I can but I don't have access to a linux server to test out gevent and haven't been able to get it to run on my mac.…
deecodameeko
  • 505
  • 7
  • 18
5
votes
0 answers

Connection time-out on telegram-bot

I am using python and cherrypy with my telegram bot. Also, I am using webhooks instead of long polling. But the bot doesn't work. Get_webhook_info returns this message: { "ok": true, "result": { "url": "https://IP/571605115:token/", …
Timur Nasyrov
  • 71
  • 1
  • 3
5
votes
2 answers

Python 3 hosting

I am looking for companies hosting websites developed in Python 3 and CherryPy. Webfaction looks good, but it is limited to Linux servers, and my site has been designed and tested under Windows. Can anyone summarise (or point me to) the changes I…
Alan Harris-Reid
  • 2,811
  • 8
  • 33
  • 32
5
votes
2 answers

CherryPy HTTPError custom response handling (*NOT* HTML)

I'm having an issue providing custom response handling for cherrypy.HTTPError. The only content that I want displayed in the body of the response is a JSON-encoded dict (this is REST API). The source code seems to indicate that…
Rob
  • 301
  • 3
  • 10
5
votes
2 answers

How to setup cherrypy server sent events

I am working on a simple web app which is done with angular and cherrypy (prototyping at the moment). I am uploading two files, and then calling a external python program within cherrypy to process them, using subprocess (popen). I am able to do…
5
votes
1 answer

CherryPy: how to stop and buffer incoming request while data is updated

I'm working with cherrypy in a server that implements a RESTful like API. The responses imply some heavy computation that takes about 2 seconds for request. To do this computations, some data is used that is updated three times a day. The data is…
eguaio
  • 3,754
  • 1
  • 24
  • 38
5
votes
1 answer

Stop request processing in CherryPy and return 200 response from a tool

My Question I am looking for a way to stop request processing in a Tool without raising an exception. In other words: I want to stop the request befor it gets to the specified controller and return a 2xx status code? Background We want our…
Chris
  • 612
  • 7
  • 16
5
votes
1 answer

Why do I need to use a web server, middleware, etc, for a simple Flask application?

I've been developing a simple MVP application, and it's time to deploy it to my production server for more thorough outside testing. It will never get a heavy traffic load, it's just something I need a small group of users to test. Now I've always…
Ryan
  • 993
  • 1
  • 9
  • 17
5
votes
1 answer

Basic Auth for CherryPy webapp

I'm trying to create a very basic cherrypy webapp that will ask the user for a username and password before the first (and only) page loads. I used the example set forth in CherryPy docs here:…
darksideofthesun
  • 601
  • 2
  • 9
  • 19
5
votes
3 answers

More efficient web framework than Web.py? Extremely Pythonic please!

I love webpy, it's really quite Pythonic but I don't like having to add the url mappings and create a class, typically with just 1 function inside it. I'm interested in minimising code typing and prototyping fast. Does anyone have any up and coming…
Luke Stanley
  • 1,274
  • 1
  • 16
  • 32
5
votes
3 answers

CherryPy and concurrency

I'm using CherryPy in order to serve a python application through WSGI. I tried benchmarking it, but it seems as if CherryPy can only handle exactly 10 req/sec. No matter what I do. Built a simple app with a 3 second pause, in order to accurately…
RadiantHex
  • 24,907
  • 47
  • 148
  • 244
5
votes
2 answers

What are some best practices for structuring cherrypy apps?

I'm writing a cherrypy app and I was wondering what the best way is for structuring my handlers and code for larger applications? I realize assignment is simple trough cherrypy.root, but what are some practices for writing the handlers and assigning…
Alexander Trauzzi
  • 7,277
  • 13
  • 68
  • 112
5
votes
5 answers

Can you display python web code in Joomla?

I'm building a Joomla 3 web site but I have the need to customize quite a few pages. I know I can use PHP with Joomla, but is it also possible to use Python with it? Specifically, I'm looking to use CherryPy to write some custom pieces of code but I…
Unknown Coder
  • 6,625
  • 20
  • 79
  • 129
5
votes
2 answers

Tracking system and real time stats analysis in Python

This question is related to an older question: MySQL tracking system. In short: I have to implement a tracking system that will have high loads using Python. For the database part I've settled on mongoDB (which sounds like the right tool for this…
Alex
  • 2,040
  • 2
  • 19
  • 29
5
votes
3 answers

Python Cherrypy 404 Error Handling

I have a web server that has all of the configurations set in the code, but I want to be able to handle all page 404 errors. How would I go about doing this in Python?
William Troup
  • 12,739
  • 21
  • 70
  • 98