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

How do I reach my application from gunicorn's pre_fork hook?

I'm using CherryPy with gunicorn and I need to have my application instance run its init on the main thread pre-fork and run some other method post-fork (assume I have a good reason - as I do). I can install a post_fork hook, but I can't see how I…
AgileZebra
  • 593
  • 6
  • 14
4
votes
1 answer

How to set up CORS in CherryPy

Overview When creating a post request from my website to my Python server running CherryPy, I receive the error Access to XMLHttpRequest has been blocked by CORS policy: Request header field content-type is not allowed by…
4
votes
1 answer

Beaker caching performance guideline

I was implemented beaker with a cherrypy application, but after some requests, the beaker response time increases about 10-14 seconds. i think after including 500 to 1000 items in cache, beaker goes down. all cached types are…
pylover
  • 7,670
  • 8
  • 51
  • 73
4
votes
1 answer

Outputting errors to browser in CherryPy

I am new to cherrypy, and can't seem to figure out how to have cherrypy emit a stacktrace or error message to my browser when an error occurs. I am running cherrypy on apache with mod_wsgi, so its particularly annoying to dig through the apache…
Jesse Cohen
  • 4,010
  • 22
  • 25
4
votes
1 answer

cherrypy.tree.mount and mod_wsgi

I used to use cherrypy with mod_python and I built my controller trees with cherrypy.tree.mount calls and I would like to keep them (they are spread through the code). Now I have to use mod_wsgi. Example: from cherrypy wiki import sys sys.stdout =…
tauran
  • 7,986
  • 6
  • 41
  • 48
4
votes
1 answer

Fix a 404: missing parameters error from a GET request to CherryPy

I'm making a webpage using CherryPy for the server-side, HTML, CSS and jQuery on the client-side. I'm also using a mySQL database. I have a working form for users to sign up to the site - create a username and password. I use jQuery to send an…
elemjay19
  • 1,126
  • 3
  • 25
  • 51
4
votes
0 answers

Making use of CherryPy as webserver for flask application

I have a simple flask application that works really well. I've been developing it separately from the main desktop application, I want to "plugin" the flask application into the main application. I also want to use cherrypy as the webserver as the…
4
votes
1 answer

Cannot connect externally to a docker container running CherryPy server

I have a simple CherryPy server running on a Docker container, and I cannot access it externally. I run it using docker run -p 8181:8181 image-name. It starts up just fine and I see the normal server log. If I try a curl (curl localhost:8181) from…
Guilherme
  • 551
  • 4
  • 16
4
votes
2 answers

Why are CherryPy object attributes persistent between requests?

I was writing debugging methods for my CherryPy application. The code in question was (very) basically equivalent to this: import cherrypy class Page: def index(self): try: self.body += 'okay' except AttributeError: …
William Linton
  • 840
  • 1
  • 7
  • 14
4
votes
1 answer

Can logging and CherryPy share the same config file?

Both the Python logging module and CherryPy's Config API use ConfigParser files. Therefore, I assumed that I could use one single config file for my own applications configuration, it's logging configuration, and CherryPy's configuration. When my…
Eli Courtwright
  • 186,300
  • 67
  • 213
  • 256
4
votes
1 answer

CherryPy - saving checkboxes selection to variables

I'm trying to build a simple webpage with multiple checkboxes, a Textbox and a submit buttom. I've just bumped into web programing in Python and am trying to figure out out to do it with CherryPy. I need to associate each checkbox to a variable so…
Joao Figueiredo
  • 3,120
  • 3
  • 31
  • 40
4
votes
3 answers

Multiprocessing apply_async() not working on Ubuntu

I am running this code as a CherryPy Web Service both on Mac OS X and Ubuntu 14.04. By using multiprocessing on python3 I want to start the static method worker() in an asynchronous way, within a Process Pool. The same code runs flawlessly on Mac OS…
gc5
  • 9,468
  • 24
  • 90
  • 151
4
votes
1 answer

Design pattern for multiple consumers and a single data source

I am designing a web interface to a certain hardware appliance that provides its own custom API. Said web interface can manage multiple appliances at once. The data is retrieved from appliance through polling with the custom API so it'd be…
Novikov
  • 4,399
  • 3
  • 28
  • 36
4
votes
1 answer

How can I configure react-router to with nginx/cherrypy and my current reactjs app

I have a working web app served by nginx with cherrypy in the backend and ReactJS for the front-end. The app grew so I want to use react-router to provide quick access to pages with URLs. For example I want that my.domain.name/user will get the…
drorsun
  • 881
  • 1
  • 8
  • 22
4
votes
1 answer

Disable weak ciphers with cherrypy (python 2)

I'm using Cherrypy 3.8.0 with Python 2 to use SSL/TLS using pyOpenSSL. I want to disable SSL3 to avoid POODLE (or other weak ciphers). Here's what I have so far: server_config={ 'server.socket_port': 443, …
jrel
  • 187
  • 1
  • 11