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

Mako Templates : How to find the name of the template which the current template is included by?

I have multiple templates that include each other, such as : t1.html : ... <%include file="t2.html" args="docTitle='blablabla'" /> ... t2.html: <%page args="docTitle='Undefined'"/> ${docTitle} ... And what I want to do is to…
felace
  • 993
  • 1
  • 12
  • 21
4
votes
1 answer

Tailing a log file

I want to add a log viewer tab to my website. The tab is supposed to print the whole log file, and after that print new lines (such as tail -F command in Linux) only. The client Side is in HTML and Javascript, and the server side is in Python. Here…
Omri
  • 1,436
  • 7
  • 31
  • 61
4
votes
1 answer

Prevent site being down during updates using nginx and Python

I have an active site that's hosted on Ubuntu, uses nginx, and the site is written in Python (CherryPy is the server, Bottle is the framework). I have a shell script that copies python files that I upload over the existing live site ones which then…
GregInWI2
  • 904
  • 1
  • 17
  • 26
4
votes
0 answers

Deploying CherryPy application using gunicorn

I have a basic application written in CherryPy. It looks somewhat like this: import cherrypy class API(): @cherrypy.expose def index(self): return "

Its working!

" if __name__ == '__main__': cherrypy.config.update({ …

Jyotiska
  • 255
  • 3
  • 15
4
votes
2 answers

Start a background process upon successful quickstart in cherrypy

I have a REST WebService built on top of cherrypy. The service goes online with the cherrypy.quickstart() call. I want to start a background process with subprocess.Popen() right after the service goes online. The cherrypy.quickstart() call is…
gc5
  • 9,468
  • 24
  • 90
  • 151
4
votes
1 answer

Multiprocessing works in Ubuntu, doesn't in Windows

I am trying to use this example as a template for a queuing system on my cherrypy app. I was able to convert it from python 2 to python 3 (change from Queue import Empty into from queue import Empty) and to execute it in Ubuntu. But when I execute…
stenci
  • 8,290
  • 14
  • 64
  • 104
4
votes
1 answer

cherrypy when to know that the server has started

I am trying to write some unit tests for a small web service written with Cherrypy and I am wondering what's the best way to figure out that the server has started, so i don't get connection refused if I try to connect too early to the service ?
hyperboreean
  • 8,273
  • 12
  • 61
  • 97
4
votes
2 answers

How to block SSL protocols in favor of TLS?

How can I block SSL protocols in PyOpenSSL in favour of TLS? I'm using CentOS 7 and have these versions: pyOpenSSL-0.13.1-3.el7.x86_64 openssl-1.0.1e-34.el7_0.7.x86_64 In my config file (this if for a CherryPy app) I have: 'server.ssl_module':…
Sam Roberts
  • 379
  • 6
  • 13
4
votes
2 answers

“no 'Access-Control-Allow-Origin' header is present” error with Cherrypy

I have the following javascript in a HTML page