About Django from the Pyramid Guy

A Talk presented by Chris McDonough
log in to bookmark.

Audience level

Novice

Category

Other

Time

September 6th, 11:05 a.m. – 11:45 a.m.


Description

An opinionated recounting of the features Django shares with the Pyramid web framework, and how the two frameworks differ, as well as a prescription for collaboration between the Django and Pyramid communities.


Abstract

About Django from the Pyramid Guy

Who Am I

What is a Web Framework

Django Docs Do It Right

Django Views Do It Right

Django Forms Do It Right

Django Convenience vs. Explicitness

Django Extensibility Does It Right

Django Defaults Do It Right

Django Reality Does It Right

What is Pyramid

Pylons Project

Is Pyramid a Microframework?

Small Pyramid Program

from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response

def hello_world(request):
   return Response('Hello %(name)s!' % request.matchdict)

if __name__ == '__main__':
   config = Configurator()
   config.add_route('hello', '/hello/{name}')
   config.add_view(hello_world, route_name='hello')
   app = config.make_wsgi_app()
   server = make_server('0.0.0.0', 8080, app)
   server.serve_forever()

Pyramid and Python 3

I'm No Genius

Pyramid Docs

Docs Pain

Pyramid Friends

Scaffolding

Bindings Packages

A more generic package is specialized for convenient use under Pyramid via use of a bindings package.

Higher Level Frameworks

Packaging Is Like a Blast Shield

Django Avoids Setuptools

Django Avoids Setuptools (2)

Subclassing Is Convenient

Globals are Convenient

Module-Scope Work Is Convenient

From Django tutorial, at module scope:

from django.contrib import admin
admin.autodiscover()

Module-Scope Work Is Convenient (2)

Pluggable Apps / Reusable Apps

Rendering Is Meta-View

Unit Tests

Static Files

Community

Collaboration (Low-Level)

Collaboration (High-Level)

Promoting Python

Unknowns