In this book, we will be exploring Django JavaScript integration and build an Ajax application using jQuery. We will build a Web 2.0 intranet employee directory, and we will aim for a solution that is Pythonic in more ways than one.
Web development that is more "Pythonic" than just Python
This book is intended to be a book about how to do web development in the spirit
of Python++.
The term "Python++" as we use it here is not the usual "Python is great," even if that may also be our opinion, but a more direct analogy to C++. When the effort was made to improve the C language, the basic kind of improvement attempted was to expand and broaden the core language. It is no accident that Stroustrup's The C++ Programming Language is far longer than Kernigan and Ritchie's The C Programming Language. The latter is a small book describing a small core language, while the former is a large book made large by the large core language it describes. The analogy intended by Python++ is somewhat loose here, and specifically does not include a large, or even a small, expansion of the core language. It is possible to tinker with the core language—easy_extend lets you extend Python to include a do-while loop (where the test condition is first evaluated at the end, not the beginning)—or add primitive syntax so you can do things like if remote_ip in 10.0.0.0:, but this
is almost beside the point.
The real possibilities for expanding Python do not need to radically expand the core language, or change the core language at all. Django (http://www.djangoproject.com/) is not a general purpose enhancement to Python: if you are automating system administration tasks, for instance, you very probably have no reason to use Django. But for a limited problem domain, namely certain kinds of web development, Django is more Pythonic than Python. Python's cgi module is good for some kinds of small and simple tasks, but if you are going to make a serious, large-scale web application with many standard functions, using Python core language + Python standard library + Django is a fundamentally more Pythonic approach than just Python core language + Python standard library alone.