Hi there,<br><br>Thanks Steve Holden for organizing this, it's a great idea.<br><br>I've been using twisted for about a year now and I love it,<br>I'm a classic case of (as you can read all over the web):<br> "after the learning curve, you'll love Twisted"
<br>so, yeah, more learning materials would be great for those starting out.<br><br>Some nice topics might include:<br><br>a) Start off simple with a "twisted.web2" example (everyone "gets" http)<br><br>
b) then plug that into a simple sqlite database using "twisted.enterprise"<br><br>c) then plug some simple usage of "twisted.pb" that does something<br> in the backend, that gets presented to the pages being served by "
twisted.web2"<br><br>d) Show how using "twistd" is really convient <br>(i.e. "twistd -ny server.tac" and "twistd -y server.tac", with some logging capability, etc)<br><br>Anyways, these are just random ideas, but they are things that took me a while to
<br>get going with, but now I find them so clean and useful.<br><br><br>Regarding Paul's post:<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I did something like that a few month back and had a hard time gathering<br>all the pieces of information ;) I still can't believe I have to parse<br>raw response strings to handle POST ;))</blockquote><div><br>You don't! This is all you need:
<br><br>from twisted.web2 import resource, http, http_headers<br><br>CTYPE = {'content-type': http_headers.MimeType('text', 'html', {'charset':'utf-8'})}<br><br>GetSomePostData(resource.PostableResource
):<br><br> def render(self, request):<br> postval0 = request.args.get("val0", [""])[0]<br> postval1 = request.args.get("val1", [""])[0]<br> html = myhtmltemplates.comment_form_response
(postval0, postval1) #for example<br> return http.Response(200, CTYPE, html)<br><br><br>- Alex<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>cheers<br><font color="#888888"> Paul<br></font><div><div></div><div class="Wj3C7c"><br><br><br>_______________________________________________<br>Twisted-Python mailing list<br><a href="mailto:Twisted-Python@twistedmatrix.com">
Twisted-Python@twistedmatrix.com</a><br><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br></div></div></blockquote>
</div><br>