Intro
django-cherrypy-odeon is a Django app that allows you to run the cherrypy WSGI server as a production or as a development server (replacing the 'runserver' command with a threaded cherrypy instance).
Installation
- add wsgiserver/ from the cherrypy project in your python path. The bundled version was patched to ignore malformed HTTP headers and to optionally output the served path to mimic devserver's behavior, so it's recommended over the upstream version.- add django_cherrypy_odeon to INSTALLED_APPS in your settings.py
Usage
- "./manage.py runcpserver help" - for the production server- "./manage.py runserver_cp help" - for the development server
Example output
- stefan$ ./manage.py runserver_cp
- Validating models...
- 0 errors found
- starting server with options {'ssl_certificate': None, 'workdir': None, 'verbose': 1, 'server_name': 'localhost', 'host': 'localhost', 'daemonize': 0, 'threads': 10, 'pidfile': None, 'shutdown_timeout': 60, 'ssl_private_key': None, 'server_group': 'www-data', 'port': 8000, 'server_user': 'www-data', 'request_queue_size': 5}
-
- Django version 1.2.1 SVN-13353, using settings 'proj.settings'
- Development server is running at http://localhost:8000/
- Quit the server with <CTRL>+C.
- [01/Aug/2010 17:34:39] "GET /labs/ HTTP/1.1" 200
- [01/Aug/2010 17:34:39] "GET /media/css/style.css HTTP/1.1" 304
- [01/Aug/2010 17:34:39] "GET /media/css/pretty.photo.css HTTP/1.1" 304
- [01/Aug/2010 17:34:39] "GET /media/js/jquery.js HTTP/1.1" 304
- [01/Aug/2010 17:34:39] "GET /media/app/labs/css/labs.css HTTP/1.1" 200
- [01/Aug/2010 17:34:39] "GET /media/css/main.css HTTP/1.1" 304
- [01/Aug/2010 17:34:39] "GET /media/js/main.js HTTP/1.1" 304
- [01/Aug/2010 17:34:39] "GET /media/js/custom.js HTTP/1.1" 304
Notes
This is a fork of django-cpserver ( http://github.com/lincolnloop/django-cpserver ) since before the BSD licence was added so we took the liberty of licensing it under GPLv3.



Discussion
File a ticket for CP and we'll see if we can't get changes into CP 3.2 so you don't have to patch anymore. :)
The header parsing patch was submitted and rejected more than 1 year ago: http://www.cherrypy.org/ticket/941
Here's the verbosity patch: http://www.cherrypy.org/ticket/1018
Leave a Comment :