.. slideconf:: :autoslides: False Supplementary Course Readings ============================= .. slide:: Course Readings :level: 1 This document contains no slides. Web programming is a deep pool. There's more to cover than a 10-session course could ever hope to accomplish. To that end, I've compiled a list of related readings that will support the information you'll learn in class. Think of this as supplemental materials. You can read it at your leisure to help increase both the depth and breadth of your knowledge. The readings are organized like the class, by session and topic. Session 1 - TCP/IP and Sockets ------------------------------ * `Wikipedia - Internet Protocol Suite `_ * `Kessler - TCP/IP (sections 1 and 2) `_ * `Wikipedia - Domain Name System `_ * `Wikipedia - Internet Sockets `_ * `Wikipedia - Berkeley socket interface `_ If you want to know a bit more about the lower layers of the stack, you might find the following readings enlightening: **Transport Layer** * `Wikipedia - Universal Datagram Protocol (UDP) `_ * `Wikipedia - Transmission Control Protocol (TCP) `_ **Internet Layer** * `Wikipedia - Internet Protocol (IP) `_ * `Wikipedia - IPv4 Packet Structure `_ * `Wikipedia - IPv6 Packet Structure `_ **Link Layer** * `Wikipedia - Link Layer Protocols `_ In addition, you may find it interesting to take a look at ZeroMQ, a next-generation implementation of the socket concept built with parallel and networked computing in mind: * `ZeroMQ Guide, Chapter 1 `_ Session 2 - Web Protocols ------------------------- * `Python Standard Library Internet Protocols `_ * An introduction to the HTTP protocol: `HTTP Made Really Easy `_ Python offers a number of external libraries that offer extended support for covered web protocols, or support for protocols not covered in the Standard Library: * httplib2_ - A comprehensive HTTP client library that supports many features left out of other HTTP libraries. * requests_ - "... an Apache2 Licensed HTTP library, written in Python, for human beings." * paramiko_ - "a module for python 2.5 or greater that implements the SSH2 protocol for secure (encrypted and authenticated) connections to remote machines" .. _httplib2: http://code.google.com/p/httplib2/ .. _requests: http://docs.python-requests.org/en/latest/ .. _paramiko: http://docs.paramiko.org/ For a historical perspective on how protocols can change (as well as how they remain unchanged) over time, skim these specifications for HTTP and SMTP: * `HTTP/0.9 `_ * `HTTP - as defined in 1992 `_ * `Hypertext Transfer Protocol -- HTTP/1.0 `_ * `Hypertext Transfer Protocol -- HTTP/1.1 `_ * `RFC 821 - SMTP (initial) `_ * `RFC 5321 - SMTP (latest) `_ Session 3 - CGI and WSGI ------------------------ * `CGI tutorial`_ - Read the following sections: Hello World, Debugging, Form. Other sections optional. Follow along using CGIHTTPServer. * `WSGI tutorial`_ - Follow along using wsgiref. * `CGI module`_ - utilities for CGI scripts, mostly form and query string parsing * `Parse URLS into components `_ * `CGIHTTPServer`_ - python -m CGIHTTPServer * `WSGI Utilities and Reference implementation `_ * `WSGI 1.0 specification `_ * `WSGI 1.0.1 (Python 3 support) `_ * `test WSGI server, like cgi.test() `_ .. _CGI tutorial: http://webpython.codepoint.net/cgi_tutorial .. _WSGI tutorial: http://webpython.codepoint.net/wsgi_tutorial .. _CGI module: http://docs.python.org/release/2.6.5/library/cgi.html .. _CGIHTTPServer: http://docs.python.org/release/2.6.5/library/cgihttpserver.html For alternative introductions to WSGI, try these two sources. They are a bit more minimal and may be easier to comprehend off the bat. * `Getting Started with WSGI`_ - by Armin Ronacher (really solid and quick!) * `very minimal introduction to WSGI `_ .. _Getting Started with WSGI: http://lucumr.pocoo.org/2007/5/21/getting-started-with-wsgi/ Session 4 - APIs and Mashups ---------------------------- * `Introduction to HTML (from the Mozilla Developer Network) `_ * `Wikipedia's take on 'Web Services' `_ * `xmlrpc overview `_ * `xmlrpc spec (short) `_ * `the SOAP specification `_ * `json overview and spec (short) `_ * `How I Explained REST to My Wife (Tomayko 2004) `_ * `A Brief Introduction to REST (Tilkov 2007) `_ * `Wikipedia on REST `_ * `Original REST disertation `_ * `Why HATEOAS - *a simple case study on the often ignored REST constraint* `_ Python offers a number of solid external libraries to support Web Services, both from the side of production and consumption: * BeautifulSoup_ - "You didn't write that awful page. You're just trying to get some data out of it. Right now, you don't really care what HTML is supposed to look like. Neither does this parser." * requests_ - HTTP for humans * httplib2_ - A comprehensive HTTP client library that supports many features left out of other HTTP libraries. * rpclib_ - a simple, easily extendible soap library that provides several useful tools for creating, publishing and consuming soap web services * Suds_ - a lightweight SOAP python client for consuming Web Services. * restkit_ - an HTTP resource kit for Python. It allows you to easily access to HTTP resource and build objects around it. .. _BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/ .. _requests: http://docs.python-requests.org/en/latest/ .. _httplib2: http://code.google.com/p/httplib2/ .. _rpclib: https://github.com/arskom/rpclib .. _Suds: https://fedorahosted.org/suds/ .. _restkit: https://github.com/benoitc/restkit/ Session 5 - MVC Applications and Data Persistence ------------------------------------------------- As we'll be learning about Pyramid over the next three sessions, please take some time to read and digest some of the `copious documentation`_ for thie powerful framework. In particular, to cover the topics we address in this session you'll want to read the following: * `Pyramid Configuration `_ * `Defending Pyramid's Design `_ .. _copious documentation: http://docs.pylonsproject.org/projects/pyramid/en/latest/index.html You may also wish to read a bit about `SQLAlchemy`_. In particular you may want to work through the `Object Relational Tutorial`_ to get a more complete understanding of how the SQLAlchemy ORM works. .. _SQLAlchemy: http://docs.sqlalchemy.org/en/rel_0_9/ .. _Object Relational Tutorial: http://docs.sqlalchemy.org/en/rel_0_9/orm/tutorial.html Session 6 - Pyramid Views, Renderers and Forms ---------------------------------------------- This week we'll be focusing on the connection of an HTTP request to the code that handles that request using `URL Dispatch`_. Quite a lot is possible with the Pyramid route system. You may wish to read a bit more about it in one of the following documentation sections: * `Route Pattern Syntax `_ discusses the syntax for pattern matching and extraction in Pyramid routes. In Pyramid, the code that handles requests is called `a view`_. A view passes data to `a renderer`_, which is responsible for turning the data into a response to send back. Getting information from a client to the server is generally handled by `HTML forms`_. Working with forms in a framework like Pyramid can be facilitated by using a *form library* like `WTForms`_. .. _URL Dispatch: http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/urldispatch.html .. _a view: http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/views.html .. _a renderer: http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/renderers.html .. _HTML forms: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms .. _WTForms: http://wtforms.readthedocs.org/en/latest/ For layout and design, CSS will be your tool of choice. There is no better tool for learning CSS than trying things out, but you need a good reference to get started. You can learn a great deal from the `Mozilla Developer Network`_ CSS pages. I also find `A List Apart`_ and `Smashing Magazine`_ to be fantastic resources. .. _Smashing Magazine: http://www.smashingmagazine.com .. _A List Apart: http://alistapart.com .. _Mozilla Developer Network: https://developer.mozilla.org/en-US/docs/Web/CSS Sesstion 7 - Pyramid Authentication and Deployment -------------------------------------------------- There are no special readings associated with this week. Sessions 8, 9, & 10 - Django ---------------------------- Though it's way too much to read in any one sitting (or even in 10 or 20), the Django documentation is excellent and thorough. As a start, take a look at these sections: * `Django at a Glance `_ - introduction to the concepts and execution of Django * `Quick Install Guide `_ - lightweight instructions on installing Django. Use Python 2.7. * `Django Tutorial `_ - The tutorial covers many of the same concepts we will in class. Go over it to re-enforce the lessons you learn * `Using Django `_ - far more in-depth information about core topics in Django. In particular, the installation instructions here can be helpful when you run into trouble. Bookmark the `Django Documentation homepage `_. It really is "everything you need to know about Django" When you have some time, read `Django Design Philosophies `_ - for some well-considered words on why Django is the way it is. Conversely, for some well-considered criticisms of Django and the way it is, read this in-depth comparison of SQLAlchemy and the Django ORM by the creator of Flask: `SQLAlchemy and You `_ Or consider viewing `this video `_ of a talk given at DjangoCon 2012 by Chris McDonough, one of the driving forces behind the Pyramid framework.