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

python cherrypy - how to add header

How can I add retry-header in cherrypy? import cherrypy import os class Root: def index(self): cherrypy.response.headers['Retry-After'] = 60 cherrypy.request.headers["Age"]= 20 cherrypy.config.update({'Retry-After':…
sam
  • 123
  • 1
  • 5
11
votes
2 answers

Using CherryPy/Cherryd to launch multiple Flask instances

Per suggestions on SO/SF and other sites, I am using CherryPy as the WSGI server to launch multiple instances of a Python web server I built with Flask. Each instance runs on its own port and sits behind Nginx. I should note that the below does…
Tom Merrihew
  • 433
  • 4
  • 10
11
votes
3 answers

Default the root view in cherrypy

In some source code I am writing, I am able to make a request such as: http://proxy.metaperl.org/index/bitgold-rw1 And have it redirect successfully. However, I want to remove index from the URL and have it still redirect by using the index()…
Terrence Brannon
  • 4,760
  • 7
  • 42
  • 61
11
votes
5 answers

Ajax calls to subdomain

I have one server located at example.com running apache, serving my static html files. I also have a json service located at api.example.com running python with cherrypy. The user requests example.com and get the index html page. On that page I make…
Baversjo
  • 3,656
  • 3
  • 34
  • 47
11
votes
1 answer

win32com.client.Dispatch + Cherrypy = CoInitialize has not been called

The following code works well, but it fails if executed from a CherryPy app method with the error message CoInitialize has not been called: import win32com.client xl = win32com.client.Dispatch("Excel.Application") xl.quit() This post suggests a…
stenci
  • 8,290
  • 14
  • 64
  • 104
11
votes
3 answers

Py2exe: Are manifest files and w9xpopen.exe required when compiling a web server without GUI interface?

I'm using Py2exe to compile a CherryPy (3.1) server using Python 2.6 (32-bit) on Windows 7 Pro (64-bit). This server will run without a GUI. Questions: Do I need to be concerned about adding a manifest file for this application if it runs without a…
Malcolm
  • 5,125
  • 10
  • 52
  • 75
11
votes
2 answers

Getting started with Cherrypy and Jinja2

This is my first time delving into web development in python. My only other experience is PHP, and I never used a framework before, so I'm finding this very intimidating and confusing. I'm interested in learning CherryPy/Jinja2 to make a ZFS…
lifewater
  • 113
  • 1
  • 1
  • 4
10
votes
1 answer

Prevent CherryPy from automatically reloading

It boggles my mind that this hasn't already been asked on Stack Overflow, but I gave it an honest search... I'm currently developing a simple web application using CherryPy (and routes and Mako, in case its relevant.) This is going fine except for…
Maxander
  • 139
  • 1
  • 8
10
votes
2 answers

Force CherryPy Child Threads

Well, I want cherrypy to kill all child threads on auto-reload instead of "Waiting for child threads to terminate" because my program has threads of its own and I don't know how to get past this. CherryPy keeps hanging on that one line and I don't…
user233864
  • 1,727
  • 2
  • 13
  • 12
10
votes
5 answers

Python Webframework Confusion

Could someone please explain to me how the current python webframworks fit together? The three I've heard of are CherryPy, TurboGears and Pylons. However I'm confused because TurboGears seems to use CherryPy as the 'Controller' (although isn't…
Vaer
9
votes
1 answer

Problems with running cherrypy's hello world example

I'm trying to test cherrypy framework by using example from their site: import cherrypy class HelloWorld(object): def index(self): return "Hello World!" index.exposed = True cherrypy.quickstart(HelloWorld()) When I run it I get this…
marcin_koss
  • 5,763
  • 10
  • 46
  • 65
9
votes
1 answer

CherryPy : Is there a best way to split the project in multiple files?

I'm new to CherryPy, coming from Django. I liked the way Django split the various parts of the project into many files, and I'd like to do the same in CherryPy, instead of having one big file. I think it would be great if I could split the project…
Cyril N.
  • 38,875
  • 36
  • 142
  • 243
9
votes
3 answers

How to make bottle server HTTPS python

I'm using Bottle as my webservice. Currently, its running on bottle's default wsgi server and handles HTTP requests. I want to encrypt my webservice and handle HTTPS requests. Can someone suggest a method for this. I tried running on cherrypy…
Gaurav Ram
  • 1,085
  • 3
  • 16
  • 32
9
votes
2 answers

How do obtain permissions to install packages for Anaconda3 on Windows 10?

I am trying to install cherrypy for anaconda3, using the following page's commands https://anaconda.org/anaconda/cherrypy, but am getting the following error message, The operating system I am using is Windows 10 and I have checked that I have…
Trajan
  • 1,380
  • 6
  • 20
  • 41
9
votes
1 answer

Static URL in cherrypy

I have a website server based on python (cherrypy), and i need some help. I'm sorry in advance if this question is too basic. I don't have a vast of experience in this area so far. My main page is on http://host:9090/home/static/index.html. I want…
Omri
  • 1,436
  • 7
  • 31
  • 61
1 2
3
91 92