views:

166

answers:

2

I am taking a session on web application development using django at a local Open Source Community.

The audience has earlier programming experience in Java or C; Some people with php and .net.

What all should I talk about. Hardly anybody would be familiar with dynamic languages. How to cover essential topics of Python?

Are there any specific quotes or pictures that I can put up in the ppt.

+5  A: 

I just did this last week.

I think it helps to provide some context for Django. View the architecture fro the outside in. Apache - mod_wsgi - Django - template presentation - view function - model.

I think it helps to look at an HTTP request's life cycle from browser to Apache to mod_wsgi to Django to the URL mapping to the view function to the template rendering.

I think that Python language features should be minimized. It's an easy language and can be discussed as side-bars.

Don't forget to briefly (very briefly) mention the essential features of Django -- url mapping, template rendering, ORM, application structuring, built-in admin pages.

I think that the real heart of the presentation should follow the Django tutorial style.

  1. Look at models first. Cover just enough Python syntax and semantics to explain what the code sample means.

  2. Look at URL mapping and view functions next. Keep these short. Focus on built-in master-detail views since they're so simple.

  3. Look at template code last. Be sure to differential Django templates (which do very little) from JSP pages or PHP (which do too much.)

I think it's important to not waste much time on Python-isms. The language can spark useless debates on multiple-inheritance, compile-time type checking and the like.

I think it's important to dwell on the Django unittest features. Those are wonderful. We use them heavily.

S.Lott
+1  A: 

A couple of things to get the ball rolling:

  • Find a piece of code that's really verbose in a language they're familiar with and rewrite it in Python. If you can show them how Python will make their life simpler rather than discussing it in terms of language features and frameworks, your job will be much easier.
  • Show off the automatic administrator interface. That's what gets everyone (myself included).

Granted, there's a lot more to be discussed to compare frameworks. But if you lead in with the big guns, you'll get their attention so much more quickly.

One other anecdote you may find useful: I seem to recall reading about a programmer who was trying to convince his co-workers that Python is the language to go with. There's the old saying "you don't truly understand something until you can explain it to an 8 year old." So he taught his 8 year old daughter to program with Python and showed his coworkers the code. Personally, I would want to learn Python if I saw a presentation like that.

Jason Baker