After really look­ing back and forth regard­ing WordPress and Drupal I decided to look around at dif­fer­ent devel­op­ment frame­works just for gig­gles and ran into Django (pro­nounced jango) again. I have run across Django before and usu­ally elim­i­nated it imme­di­ately because it is Python based instead of PHP. But for what ever silly rea­son… uhm, yeah, PHP using the back­slash (\) for name­spaces… instead of throw­ing Django out, I took a look at it, just to remind me why I didn’t like Python.

I can sum up my gen­eral dis­com­fort with Python in one word, “spaces.” Python uses indents as its pri­mary struc­ture and highly relies on/recommends spaces instead of tabs for those indents. I find myself always mess­ing stuff up when I use spaces instead of tabs, one too many, one too few. Oh, not when I first write the code, the text edi­tor does take care of that but when I come back to the code and start mak­ing mod­i­fi­ca­tions. spaces always messes me up.

And those spaces are impor­tant since Python uses indents instead of braces for orga­ni­za­tion… let me give an exam­ple of tra­di­tional code which will look ugly because I will do what it lets me do first then the same thing in python:

if(true) { do this; do that; } else { do the other thing; }


if true:
    do this
    do that
else:
    do the other thing

Now some would say the python way is “cleaner,” eas­ier to read. Well, I could have made the first exam­ple with mul­ti­ple lines, indents and orga­nized it very sim­i­lar to Python, and I always do so it would look almost exactly the same except for the braces ({}).  Python how­ever enforces that type of struc­ture of mul­ti­ple lines and indents unlike say PHP which relies on the braces to know what it is doing so you can write ugly code as in the exam­ple. I like the com­fort of the braces for the struc­ture, it really empha­sizes what is what. But really, once you get used to writ­ing in in a par­tic­u­lar lan­guage, it feels nat­ural and even­tu­ally even “the right way.” So Python could even­tu­ally feel as com­fort­able as PHP. But using those darn spaces instead of tabs will always get me.

So, Python hasn’t become the stum­bling block that it might have been in the past. I have been play­ing a lot with Django. There is a lot to like about it, some things I am not sure about, but in an odd way, it may become the thing for which I have been look­ing… at least for more com­plex web devel­op­ment. It works well with PostgreSQL as well as other DBs. It makes doing data­base stuff easy… you can almost for­get SQL except maybe for real com­plex queries. It has a bunch of pre-made apps… yeah, the ter­mi­nol­ogy gets a bit “dif­fer­ent” at times… but Django is really designed to help a devel­oper quickly develop cus­tom apps to flesh out a par­tic­u­lar website.

In Django, you start with a “project” which in my mind equals the dynamic part of the web­site. Static stuff like images, css, etc may actu­ally be served out­side of the project, even from a dif­fer­ent web server. Each project then has mul­ti­ple apps. Each app has a spe­cific pur­pose within the project/website.

Who knows where this will even­tu­ally lead but I am find­ing myself lik­ing Django a lot because I sud­denly feel like the straight jacket is a lot less con­strain­ing… or maybe the padded cell is a lot larger. I am sure as I work with it more, there will be things I won’t like and who knows, even­tu­ally I could end up back work­ing with Drupal after all (WordPress will prob­a­bly always be some­where in my tool­box). But for now, it has my atten­tion and I am hav­ing fun play­ing with it.

Tagged with:
 

Leave a Reply

Looking for something?

Use the form below to search the site:


Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...