Welcome!

My name is Jacob Kaplan-Moss; I’m one of the lead developers of Django and the lead developer at the Lawrence Journal-World, where Django originated.

In the next three hours I’ll be diving into some of the deeper details of how Django works. This is something of a continuation of the beginning tutorial, but if anything this will be more of a skim than that one was. There isn’t possibly time to cover everything I’d like to cover, so most coverage will be designed to give you a push in the right direction (but from there it’s up to you and the documentation).

1

Unlike the beginning tutorial which is somewhat well-defined, this advanced one is much more dependent on the attendance. So who’s here?

2

Most people here today consider themselves pretty skilled at Python. That’s good -- I’m going to assume you understand things like iterators, descriptors, and their ilk.

3

However, a sizable chunk of you are relative n00bs to Django. That’s OK -- most people who said they’re beginners sat through the first tutorial, and should be somewhat prepared.

4

About what you’d expect from background, too.

5

So, based on your questionnaires, here’s what I’m going to (try to) cover.

6

7

8

Imagine a “story” object with an active flag. We’ll probably end up doing this filter a lot.

9

Here’s the quick way.

10

Here’s another way of doing it to prevent those stories from showing up at all.

11

12

This is better; Django (and you) will still be able to access the inactive stories.

13

14

The demo project has been using ‘em all along, so let’s see how they work, eh?

15

16

17

18

19

20

So, what happens when you declare a model?

21

Yes, complicated. The next example should help.

22

Let’s look at a simple (imaginary) VoteCount object for packages

23

24

25

26

27

A very simple function to notify me whenever something changes. How can I arrange for this to be called?

28

29

Here’s a (marginally) more useful example: email me whenever a user updates his/her account. Notice the “sender” bit.

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

That’s all I got, but that’s far from all there is.

I hope you’ll keep hacking on Django. If you’re at all interested, I recommend joining the users group; I really take pride in the quality of our community.

And feel free to email me directly any time.

55