I'm currently realizing a web server for my company which allows control of
some of our embedded devices. After some research, I decided on python and
twisted as the way to go using genshi as templating engine, which works very
The problem I encountered is as follows: The user of the web panel should also
be able to upgrade the firmware on our device. To make this possible, a file
upload has to take place. The firmware file can have a size of up to 150MB, so
it will not fit in the RAM of our device. It either won't fit on the NAND flash
chip twice, so it should be written to NAND with its final name and not as a
temporary file. To tell the server where to store the file upload, I could add a
hidden input to the upload form indicating the type of the file being uploaded,
so that the web server can save it to the right location.
Where's the place to hook in twisted to implement such a behaviour? Do I
really have to write a completely independent implementation of the HTTP
handler or could I also reuse some parts of twisted.web?
Does some code exist already which implements the wanted behaviour or could be
modified to implement it?
Thanks for your reply,
Hi! I need to download a fragment of a file using HTTP. The file is
stored in several hosts, and I need to handle the case where one or
several hosts are down, or do not have a copy of the file, or the
connection fails for any other reason.
Inspired by the Twisted client tutorial
I've written a function called ``download()``
(http://gist.github.com/481575) which iterates through a list of URLs.
I find the resulting code a bit too long, however -- in particular the
need for the ``FileWriter`` class.
Have I overlooked some Twisted helper code, or some Twisted coding
idiom, that could simplify the example above? Can you guys think of
any way to improve that code fragment?
Thanks a lot,
I posted this question already to comp.python.twisted
just to discover a little later, that comp.python.twisted.web
might be more appropriate.
So here is my post again
I'd like to implement a small https twisted server,
which can wrap a wsgi module and which
can verify client certificates
I am able to do this with apache, but would like to do the same with
(For some projects it would allow me to get rid of apache or to perform
certain tests on a Windows hosts)
What I have running is following shell script
twistd -n web --https 4433 \
--certificate $certfile --privkey $keyfile \
Basically I just use my wsgi script and didn't write any twisted code.
My first step would be how to write the same twisted code without
The next step how to enforce enable client certificates
I wondered where I could find any good example code
implementing a web server with client certificate authentication
( and ideally with a subsequent wsgi module)