Create your own awesome maps

Even on the go

with our free apps for iPhone, iPad and Android

Get Started

Already have an account?
Log In

InfoBuzz by Mind Map: InfoBuzz
0.0 stars - reviews range from 0 to 5

InfoBuzz

uses HTTP properly

Entry.objects.filter(author__first_name__startswith="J")

adjacency list (fast writes, slow reads)

stand-alne

manual documentation page there

select_related

django abstracts the db but is sensitive to performance

e.g.

Untitled, generates 2 queries

e = Entry.objects.select_related().get(pk=1), pre-join query

in general, your page performance is correlated to the number of queries that gets executed

select_related(depth=2)

look at the generated sql from select_related

.query, shows the SQL

filter

EXIF parsing

reads photo metadata (eg location) from jpg's

base models

standard in any large django project

you need to add the 404, 500 templates

test can't work on debug

are immutable

qs1 = ..

qs2 = qs1.filter(...)

doesn't change qs1

select_related('field1', 'field2')

celery

Task queue for Python

you can limit the select_related to save memory taken by select_related

which fields

to what depth

About

"Django is a high-level Python web framework that encourages rapid development ddd clean pragmatic design"

dddd

Came from newspaper environment - very short dead-lines

Boss usually came back from lunch & requested stuff by EOD

Favour agile iterative methodology

To balance "clean" & "pragmatic"- Django guides you how to do things the right way

Install

quick way

easy_install django

http://bit.ly/dsetup, distributed setup

best way

virtualenv

models

inspectdb

mgmt command to start with existing db

always add related_name

admin

syntax for customization

Untitled

Original motivation

Allow content editors to start entering data while developers develop the application

list_editable

templates

filters

can be piped

tags

length

regroup

inheritance

extends must be 1st line

the more blocks the better

if you're duplicating code, you're missing a block

block.super

queries

all

get

exclude

opposite of filter

field lookups

exact, iexact

in, name__in=(...), author__in=Author.objects.filter(...), will create an SQL with sub-query

range

...

following relationships

Query Sets

are chainable

e.g., filter & then exclude

are lazy, they're evaluated only when, iterated, slicing, because mysql sucks, print, len(), list()

eco-system

djangopackages

selected apps

django-extensions, many manage.py extensions, graph_models, passwd, runserver_plus, show_urls, shell_plus, custom fields

django-treebeard

Supports Whoosh & Solr & recently also ..., Whoosh is python

django-photologue, on-the-fly photo resizing & effects, enhanced image field & base classes, Bulk image upload, Photos, galleries, tree-like data structures, materialized path, best avg-case performance, nested sets (slow writes, fast reads)

easy-thumbnails

django-registration

django-taggit, just add to the model, tags = TaggableManager()

haystack, full-text indexing & search, Automatic update of indexed models, Automatic 2-way sync, when you change a model, it updates the index, Query via strings or QuerySet-like interface, Support for advanced back-end operations

piston, RESTful API framework, either, model-linked, pluggable auth, Validation, throttling, streaming, there's a utility that updates the fixtures when you're changing data

south, migration tool, that's the 1st thing Jacob installs in a new projects

bigger apps

pinax, social apps

satchmo, ecommerce apps

sample app

metric

app for recording stats

invoked in views & save method of models

tasks

uses decorator

api

/api/v1

using piston

iterative test-driven cycles

rapid iterations, whats the smallest thing we can build in a day, then whats the next thing we can add, & so on

feedback as soon as possible

at any given moment, this works

testing

dump fixtures

sample

Untitled

uop

test

food

poop