14
dec
2009

Django, it's just Python.

'It's just python' A statement I've heard a number of Django people use. I happen to think its quite relevant and important to remember. Django is stupidly easy to get started with, you feel empowered when you make your first website and its amazing. You can do so much and you only need to write a few lines of code. At this point yes you are writing python, but, really your not. I'm talking Django tutorial level code, after completing that you wouldn't claim to being a python coder would you?

Luckily after playing with Django for a bit I realised how great python is as a language and I chose to do my MSc Dissertation research with python - that was a great idea. It was my first real piece of python code without Django1 and I really struggled at first, it was only at this point that I ran into strange gotchas and silly things like circular imports that at the time confused me. Django really encourages a set layout and manages hooking it all together for you.

I learned a lot in this project about python, it's by far the most profitable piece of work at university for me but that's mostly because I enjoy python and the c, perl, java and c# (and more) I learned at university I've not used otherwise. After doing this I started noticing patterns changing in my websites I was doing more with python and less with Django. You could say I stopped trying to bend Django to do what I wanted and dove in deeper creating solutions that took more advantage of the features in Python.

A good example of this is how I changed my approach to creating Dynamic forms with Django (an article about this is coming soon). I no longer tried to bend what Django gave me but used python to make it fit my needs much more.

At this point it struck home to me, I'd only been using about 50% 2 of Django's power. Don't get me wrong, Django is fantastic but Python is also awesome. Looking back at some of my early code I'd written with Django makes me cringe, the way I tried to bend the framework with programming idioms that I brought from my previous language.

So what am I saying here? Basically, if you came Python like me because of Django or another reason that meant you didn't really learn python from the ground up. You will be empowered with a wealth of knowledge and probably like me be much happier. The ecosystem, open source projects and tools out there in the general python community are absolutely fantastic.

Don't be afraid to dig into the Django tutorials, you can often find there is code and other bits there that is really useful but be aware that if these are undocumented it means they may change in future releases.

Only when you truly understand the ways of the snake will the real pony magic be available to you.


  1. None of my Django sites were particularly large or complicated, so this is really not surprising.  

  2. An arbitrary number is a bit irrelevant and pointless especially since I just made it up. However, I think you get the point.  

Previous Post: Itchy Fingers
Next Post: SiteSprint - The post-mortem

Short url - Related tags: django, python

blog comments powered by Disqus