Learn Python/Django and get ready to launch your own idea on Internet

You have ideas but you never got to create something because you are not a developer or specifically a web developer. That has become such an ubiquitous problem that its not an acceptable excuse anymore. Thankfully to the rapidly evolving web frameworks, you dont need to know a ton lot to create your own application prototypes. I have programming background but never did web development before until 12 days ago. Since it was really not as difficult as one expects, I thought I’ll share the experience and encourage aspiring entrepreneurs, web developers to try it for themselves.

Django or Rails – If you have never heard the word Django before, don’t fret – its a web framework for Python which is incidentally evolving very fast and possibly stealing people away from Ruby on Rails. You can read this discussion on Django vs Rails on Quora if you are undecided between the two. I had tried Rails before (following the excellent tutorial from Michael Hartl) just to get a feel of all the hype surround RoR and found it great at that time. I never delved deeper as I was not trying to actively build something but when I tried Django over past few days, I can definitely say that Python is easier to learn than Ruby and Django offers several advantages over Rails – biggest for me is the ready-made admin interface. More and more companies are leaning towards Python/Django now and if you have to take a pick, I bet Django is the way to go.

I’ll document how I learned Django to create a standalone application over a series of posts. Since I am familiar with object oriented programming, linux command line and mysql before, I did it at faster speed but even if you dont, you can do this in few weeks.

Overall, this was my learning path:

  • Day 1 – Setting up Django on your laptop
  • Day 2-5 – Reading and working the examples given in Django book
  • Day 6-10 – Start following Django 1.0 Website Development by Ayman Hourieh and apply the steps in building prototype of your own idea (if you do not have an idea yet, simply follow his examples)
  • Next – Add other functionality to your idea as needed (google for solutions when you are stuck) + work on design (which is a whole new beast)

This first post is going to cover ‘getting started on Mac’ (isn’t that what everyone who is interested in this post using now anyways?)-

Setup Terminal – I recommend that you setup a happy coding environment (terminal) before you begin – this can make a lot of difference in your motivation and desire to proceed especially when you are frustrated on being stuck somewhere. If you have never used Terminal before, you can read a crash course. Terminal offers various theme settings, I recommend using one with dark background – I personally use Pro (semi transparent black background and white text).

Just learn the basic cd, ls, mkdir, ln, chmod, sudo commands and try to be comfortable with some text editor – I recommend vi (if you have never ever done this, spend 2-4 days learning to enjoy this). Now, the happy part, add this to your .bash_profile (if it doesn’t exist, create one using sudo vi ~/.bash_profile)

# configure my multi-line prompt
==> \e[m’

It should make your prompts colorful, mine looks like this-

Next, I wanted a good coloring scheme for vi because you will be spending a lot of time writing and editing code inside vi editor (if you choose to go along with it). So, I added this to my .vimrc (create one if needed – vi ~/.vimrc)-

colo desert
syntax on
set number
set expandtab tabstop=2 shiftwidth=2

And now, my vi editor is colorful, highlights the syntax, shows line numbers (helpful in debugging when you get an error), sets tab at 2 spaces as used in many coding examples online –

And that can make a lot of difference when you are spending hours on command line following the examples from django books. I have barely touched anything in depth but with these minimal efforts, you can get going. If you have any questions, leave a comment and I’ll try to help.

Next post will cover setting up Django and mysql on Mac. If you want to read some other helpful posts meanwhile, try Eddy Chan’s How I learnt Python Django.

Update: Read next post – Setting up Django and MySql with and without MAMP here.


Leave a Reply

Your email address will not be published.