Django multi-tier

9

Click here to load reader

description

Implementing multi-tier architecture in Django

Transcript of Django multi-tier

Page 1: Django multi-tier

Multi-tier Implementation

inDjango

Sebastien Mirolo@seabasscapoeira

[email protected]

Page 2: Django multi-tier

djaodjin-saasSoftware-as-a-Service as a

Django App

Page 3: Django multi-tier

Productized: HTTP Firewall

One Django Proxy Server,with runtime selection of:

- templates- database connections- urlresolvers

Page 4: Django multi-tier

Disclaimer“In theory there is no difference between theory and practice. In practice there is.”

- Yogi Berra

PLEASE, DO TRY THIS AT HOME !

Page 5: Django multi-tier

Runtime SelectionTemplates

• middleware• thread local• template loaders

Page 6: Django multi-tier

Runtime Selection Databases

•middleware

•thread local

•database routers

•django.db.connections.databases

Page 7: Django multi-tier

Runtime Selectionreverse(url_name)

Page 8: Django multi-tier

LESSONS LEARNED Caching without a CacheManager is Evil.

def value(self):

if not has_attr(self, _value):

self._value = self.compute_value()

return self._value

The Entire Rendering Pipeline must be Configurable on a Request.

(not talked here) Class Views and Mixins are amazingly flexible.

Page 9: Django multi-tier

Thank YouSebastien Mirolo

@[email protected]