This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

Beginning Python Webservices

My recent threads

You haven't posted any discussions yet.

Recently updated threads

Class 2: HTTP roundup and homework

Go back to: General discussion

So, just to recap, last Thursday we covered what a web service is
(http://k0s.org/mozilla/craft/introduction.html) and last night we
went over the basics of HTTP
(http://k0s.org/mozilla/craft/http.html).  We didn't quite get through
everything on HTTP (we got up to
http://k0s.org/mozilla/craft/http.html#webcalc) but I think there's
nothing vital that you can't pick up from the page + references and
going on with the rest of the course.

If anything is either unclear or you just want to talk about it,
please feel free to email me or to start a discussion in the forums.

I also assigned the first homework: questions 1-3 from
http://k0s.org/mozilla/craft/questions.html . These are due next
Tuesday (this should be plenty of time, so no late assignments will be
accepted).  In general, the homework questions are to reinforce
understanding and are mostly essay (also, expect the list to grow;
I'll also try to organize them better going forward).  Points will be
given for being illustrative as well as being correct.  This doesn't
mean you have to write a dissertation, just put some thought into your
answers and explain why you're answering as you're answering.  Most
questions, like life, don't have definitive answers.  Email me either
directly or via the course contact form with your answers.

Next time, we're finally going to get to programming!
http://k0s.org/mozilla/craft/python.html This is a somewhat monsterous
page and will probably take at least a class and a half, but I hope to
at least get to WebOb because after that you should be able to program
albeit simple web services.

Why is this important?  Class project!
http://k0s.org/mozilla/craft/project.html So most of the class will be
centered around programming one or more web services.  I'll actually
go over this first next class so that you can have it in mind while
we're learning python.  Take a look at the example projects and feel
free to ask for more details about them (I'll try to fill in a bit
more what I mean by them, but I'm swamped, so no promises). I don't
expect you to start on your project right after next class (though of
course you're free to), but next week after we have a bit more python
knowledge might be a good time.

I found it challenging to try to lecture via skype and type into IRC
at the same time.  Like I've said, it's my first time doing this!  I'd
like to put more useful notes into IRC so that they can be posted for
people who can't make the class (which given my awful timeslot I can't
really blame them) and those who are less auditory learners.  Speaking
of, does anyone have logs from last night they could post?

I hope things are going well for everyone.  Make sure you understand
the basics of HTTP and, as always, feel free to ask any questions.

Jeff

P.S. I brought up that my web server redirects if you try to go to a
directory URL without a slash so that the links are correctly
interpreted by the browser, but I wasn't sure what redirect code I was
issuing.  Turns out, I was correctly issuing a Moved Permanantly:

> curl -I http://127.0.0.1/mozilla/craft
HTTP/1.0 301 Moved Permanently
Server: PasteWSGIServer/0.5 Python/2.6.5
Date: Wed, 22 Sep 2010 16:27:12 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Location: http://127.0.0.1/mozilla/craft/

Caley Woods's picture
Caley Woods
Wed, 2010-09-22 20:37

I have a log i'll get posted.

Caley Woods's picture
Caley Woods
Thu, 2010-09-23 18:11

I posted this yesterday, guess it didn't take. I came across this cheat yesterday that will be helpful for the class.

http://www.quicklycode.com/cheatsheets/http-response-cheat-sheet