reloadinghandler

A HTTP request handler shim


Keywords
http, testing
License
Other
Install
pip install reloadinghandler==0.1

Documentation

-*- text -*-

I wrote this before I was aware of flask or web.py. I think you'd be
better off using one of those instead.


ReloadingHandler is an experimental, specialized HTTP request handler
class to be used with Python's HTTP server modules.  It is a shim that
fits between the HTTP serving aparatus and your real handler that
reloads your real handler upon every request.  This makes developing
and debugging your server very fast: whenever you make a change, just
save your work and hit the server again -- no need to stop and restart
your server.  When your handler is debugged and ready for production
or benchmarking, only a simple change is necessary.

driver.py is a simple example of how to use the ReloadingHandler, and
MyHandler.py is a simple handler module/class.

The source is available at github: http://github.com/maw/reloadinghandler.

TODO:

* Make it work with Python 3.  It shouldn't be hard at all, but I
  haven't tried yet.

* It could probably be adapted to SocketServer.


Some of the code here is loosely cribbed from
http://www.blendedtechnologies.com/python-trick-really-little-http-server/220.  Thanks!