Posted Tuesday, January 12, 2010 at 10:37 p.m. by Chris Amico in Projects about Django, journalism, programming and Python
As of this month, I'll have been using Django for two years, and using it professionally for a year. That's a strange thing to think about, because I still have a hard time calling myself a "programmer" (though "web developer" feels easier, for some reason). I am, after all, a politics major with zero formal training in computer science. Yet here we are.
Over the past few months, friends have started asking me about my favorite framework: How'd I get started? Is it as good as the hype? Can I, or should I, learn it?
Well...
Why I learned Django
Let me start by repeating what I said two years ago: I never meant to. My plan was to learn Drupal and possibly Google's map API. I really didn't know what Django was or why Python would become a language I would want to work in.
What diverted me was Matt Waite's blog post on learning Django. I followed the links, started playing, and ended up somewhere very different from where I intended to be. Such is life, I suppose.
Some of what I like about Python, in no particular order:
- I can read it: Yes, Python has significant white space. Indentation matters, which is rare in programming languages. There's also a style guide. All this makes for code I can walk through, even if I don't understand everything that's going on. More than anything else, this is how I have learned the language.
- The interactive interpreter: Getting instant feedback means easy wins. And it's even better with IPython.
- It's modular: So, if you've written a piece of code that does something I need done, I can probably use it, without having to copy/paste.
I know, other languages do this, too (all of the above, I'm pretty sure, applies to Ruby). Maybe I'll learn them eventually. But for someone coming to code with no real history in building things on the web, Python makes for quick wins and builds good habits.
Django builds on all of this.
It is meticulously documented, better than anything else I've used. Parts are (mostly) interchangeable, and quite a bit is usable outside of a full project. Enough is pre-built that wins come quick and errors give you back lots of information to figure out what to fix.
(For a more general explanation of why lots of other people like Django, read this thread on StackOverflow)
Django also comes from journalism. The turf and work flows of a newsroom are evident in its design. Models and views are Python, and meant for programmers. Templates are (mostly) HTML, and make no assumptions about programming knowledge. The admin is automatic and can be up in time for reporters to start plugging in data. Concerns are separated. This is, in most cases, a good thing.
Why not Drupal (or Rails, or Wordpress, or...)
I don't really have a good answer here, except that I find that Python and Django really suit the way I think and work. It feels natural, if a programming language can be described in such a way.
Maybe you like Ruby on Rails. Or Drupal. If you can build what you need in those (or whatever), great. There is no right answer here. Ask your techie friends which is better, and, well, Aron Pilhofer can tell you what happens (and he'll tell you Django sucks).
The only advice I can offer for journalists thinking about learning to code is to try it. Try everything. Find something that works for you and get really good at it. Then you, too, can write long blog posts about why that framework is your new bicycle.
In my next few posts, I'll go into more detail about learning Python and Django and answer some specific questions I've gotten from friends.
If you have an questions of your own, please leave a comment.

jan 15, 2010 at 3:52 p.m. // Michelle Minkoff said:
I'm really looking forward to hearing more about this.
A few points I'd love to hear you touch on in future posts:
1.5. Time management. Coding can be such a time vacuum -- especially if you're enjoying what you're doing. How did you work to keep a balance between other aspects of life and gaining your new skills?
What specific resources did you use? I imagine there was a lot of examining other people's code. Any people who you paid particular attention to?
Did you focus specifically on Python as a separate language, or did you come to it through Django? Have you felt the drive to pick up other languages now that you've gotten started?
How much attention do you pay to standards and "good" coding practices, in order to keep your work at a professional level that can be easily understood by others? Do you think you are as meticulous, less so, or more so than those w/a formal programming background?
Thanks!
jan 17, 2010 at 3:09 p.m. // Greg Linch said:
@Michelle: Funny enough, Chris got his current job -- in part -- as a result of a Django side project. More on that.
jan 17, 2010 at 3:24 p.m. // Andrew said:
Thanks for taking posting these thoughts, Chris. I've been struggling to find the time and energy to learn Django/Python for the past year.
Why? Well, my motives mirror yours. I'm not a developer/programmer in any sense of the word, and I have no formal training in computer science. Yet the site I work for runs on Django, and I feel I should learn it to expand the kind of projects I'm working on.
I've got to take a furlough this quarter, and I've decided to use that week to put myself through a mini boot camp of my own design. If you have any other breadcrumbs to drop about how you taught yourself Django (i.e. worked through the book, made a goal of building a site), I'm sure I'm not the only one who would love to hear them.
jan 25, 2010 at 11:40 a.m. // james cai haibin said:
Hey,
I like what you've said here. We almost got the same experience. Keep on writing. :)