Home » Labs »

django-cherrypy-odeon

django-cherrypy-odeon

a Django app that allows you to run the cherrypy WSGI server as a production or as a development server

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

  1. stefan$ ./manage.py runserver_cp
  2. Validating models...
  3. 0 errors found
  4. 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}
  5. Django version 1.2.1 SVN-13353, using settings 'proj.settings'
  6. Development server is running at http://localhost:8000/
  7. Quit the server with <CTRL>+C.
  8. [01/Aug/2010 17:34:39] "GET /labs/ HTTP/1.1" 200
  9. [01/Aug/2010 17:34:39] "GET /media/css/style.css HTTP/1.1" 304
  10. [01/Aug/2010 17:34:39] "GET /media/css/pretty.photo.css HTTP/1.1" 304
  11. [01/Aug/2010 17:34:39] "GET /media/js/jquery.js HTTP/1.1" 304
  12. [01/Aug/2010 17:34:39] "GET /media/app/labs/css/labs.css HTTP/1.1" 200
  13. [01/Aug/2010 17:34:39] "GET /media/css/main.css HTTP/1.1" 304
  14. [01/Aug/2010 17:34:39] "GET /media/js/main.js HTTP/1.1" 304
  15. [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

  1. Robert Brewer on Aug 01, 2010 - 22:48 said:

    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. :)


  2. 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 :

(required)


(required)




(required)





 
Page generated in: 0.08s