tags:

views:

248

answers:

4

what are some good books/tutorials online that show python's use in web development. I dont want to start out with django. I want to actually get to the meat and do some examples myself then I can start messing with django.

I looked at dive into python3 but only chapter it has that is somewhat relavant to the web is web services. what about actual web development? creating forms, connecting to DB, fetching/showing data?

A: 

I'd recommend taking a look at Pylons.

"The Definitive Guide to Pylons" book covers version 0.9.7 and is available for free to read online.

This screencast also demonstrates connecting to a database and selecting, editing, updating data using the framework.

Peter McGrattan
+13  A: 

WSGI is an excellent choice of abstraction levels from which to start studying Python web programming -- every important Python web framework and server (except for async ones such as twisted) supports it as the "standard Python way" to interface web servers (Apache, nginx, App Engine, etc) to web apps or frameworks. Besides the links at the first URL I gave, I recomment this tutorial, Bicking's "do-it-yourself framework" classic, and Rossi's excellent presentation.

Understanding HTTP will help, as will other web technologies such as HTML, CSS, etc.

BTW, I heartily commend you for wanting to understand what's going on rather than diving head-first into a heavily magical framework that does lots of stuff for you but by the same token necessarily hides a lot of stuff for you. A necessary though not sufficient condition to become really great developer using a certain level of abstraction is to understand at least 1-2 levels of abstraction below the one you're chiefly consuming!!!

Alex Martelli
Thanks alex. that means a lot coming from you. I was thinking twice before asking that question..thinking I had missed something.
Drake
@Drake, tx for the kudos! I've long been on record on my fundamental stance about this: to be a great user of abstraction level X, you need to fully understand X-1 (and sometimes X-2;-), because "all abstractions leak" (Joel Spolsky's "Law of Leaky Abstractions"). Once you DO grasp X-1, you'll know when to use the framework at level X (most of the time, if it's a good framework, and I can't deny Django IS, if a bit non-trasparent/magickal at times;-), and when to bypass it and read down lower; AND you'll know what to do when things leak and weird bugs surface...!-)
Alex Martelli
+1 for linking Ian Bicking's DIY framework (very cool), and for the Python Cookbook, 2nd Edition :)
cjrh
A: 

The Django book explains how Django was designed, and why each technical decision was made. It is not a cookbook. Surely, if you want to learn the fundamentals of web programming with a Python slant, you will struggle to do better. If nothing else, the discussion in the book will educate you about dark corners of web apps, like the need to escape everything, and why the model must be separated from the view, and how that can be achieved, what are the issues, how are SQL table joins managed from an ORM, and so.

In other words, I'm proposing that the Django book is, in a sense, an applied case-study in designing a web framework in python. Having said that, I recently read up a bit on web2py, and it sounds somewhat interesting. Their website has a lot of compare & contrast with other web frameworks (even non-Python ones), which should be of great interest to you in terms of learning how the standard problems of web programming have been tackled by various people.

I acknowledge the desire to understand all the details that "frameworks" hide, but it never pays to disregard the open literature, regardless of the field of study.

cjrh