0%

Book Description

Even though JavaScript tools dominate today’s web development landscape, Python provides aspiring web developers with a wide variety of useful web frameworks, written in a powerful, easy-to-learn language. This O’Reilly report surveys 30 Python web frameworks that have more than 1,000 monthly downloads and provides a deeper look into six of the most widely used.

Longtime Pythonista Carlos de la Guardia describes Python web frameworks ranging from full-stack options that offer a lot of functionality to micro frameworks that focus on simplicity with fewer features. You’ll not only get pointers on how to choose a framework that best fits your development needs, but you’ll also learn what it takes to create your own.

  • Take a tour of Python frameworks, from Appier, Cyclone, and Fantastico to Grok, Muffin, and Twisted
  • Dive into details on the top six Python frameworks—Django, Flask, Tornado, Bottle, Pyramid, and CherryPy
  • Review code examples, testing capabilities, best uses, and ways to get started with each of the top six
  • Learn Python’s building blocks for creating your own framework, and explore why you’d want to pursue this option

Table of Contents

  1. Introduction
    1. What Do Web Frameworks Do?
  2. 1. Python Web Framework Landscape
    1. Web Framework List
  3. 2. Some Frameworks to Keep an Eye On
    1. Django
      1. Quick Start
      2. Representative Code
      3. Automated Testing
      4. When to Use Django
    2. Flask
      1. Quick Start
        1. Flask “Hello World”
      2. Representative Code
      3. Automated Testing
      4. When to Use Flask
    3. Tornado
      1. Quick Start
        1. Tornado “Hello World”
      2. Representative Code
      3. Automated Testing
      4. When to Use Tornado
    4. Bottle
      1. Quick Start
        1. Bottle “Hello World”
      2. Representative Code
      3. Automated Testing
      4. When to Use Bottle
    5. Pyramid
      1. Quick Start
        1. Pyramid “Hello World”
      2. Representative Code
      3. Automated Testing
      4. When to Use Pyramid
    6. CherryPy
      1. Quick Start
        1. CherryPy “Hello World”
      2. Representative Code
      3. Automated Testing
      4. When to Use CherryPy
  4. 3. What’s the Right Framework for You?
    1. Don’t Look for Absolute Bests
      1. The “Best” Framework
      2. The “Fastest” Framework
      3. The “Smallest” Framework
    2. Start by Defining Your Goals
    3. Desirable Features
      1. Documentation
      2. Active Community
      3. Reliability
      4. Extensibility
  5. 4. Developing Your Own Framework
    1. Why Create a Framework?
    2. Parts of a Basic WSGI Framework
      1. Routing
      2. Templates
      3. Other Features
      4. Documentation
    3. Framework Building Blocks
      1. WebOb (http://webob.org)
      2. Werkzeug (http://werkzeug.pocoo.org)
    4. Some Useful Resources
  6. 5. Summary
  7. A. Python Web Development Fundamentals
    1. It’s All HTTP Underneath
    2. Web Servers and WSGI
    3. Installing Python Packages
      1. Requirements for Installing Packages
      2. Using pip
      3. Virtual Environments