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
PS1=’\e[0;32m[\u@$PWD]\$
==> \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.

 

Posted in Technology | Tagged | Leave a comment

Life goes on

I had been waiting to write a perfect post, to write it perfectly and to have some magical effect. But then I realized, life does not work like that. While waiting for those perfect moments, we miss on many good ones, many great ones. Life doesn’t have to be lived waiting for those milestones because sometimes the smaller, less significant moments will capture its reality better.

I started painting again after a long time. And the moment I put the first stroke, I felt like an idiot for not doing it all this while. But its fine because I know what I missed. This year has been a phase of awakening for me and as I go through it, it feels liberating. I believe life needs such stirrings else the essences of life start to precipitate at the bottom of the jar. I don’t want to lose those, I want to keep stirring my life so that I can keep feeling alive. Stagnation has no place in a life worth living. When one stops growing, one does not stay stationary – one diminishes.

And this reminds me of my first case study in MBA program. It was a case on Iggy’s bread and ignoring the nuances, the question to me was whether the successful small shop should try growing or not. It was a valid question to me at the time. If a business is doing great in its present form, does it need to grow or innovate or evolve? The answer is seemingly more clear to me now. There is no alternate to growing – it does not have to be in size but it needs to be in one’s position, understanding, grade – whatever you may want to call it. Because when you don’t grow, someone else is and comparatively, you’ve shrunk. In business world it’s a race to lead and even once you win that, it’s a race to keep ahead – it does not stop.

At human level, the competition is more intra- than inter-. I think the growth happens when you think you are beginning to understand better and know more. Then comes a point where you realize you don’t know enough and you possibly can never know enough. This is an important milestone and the real life starts now. And then, you keep growing as you discover the enormity of life – your priorities become clear and you learn what should not bother you. Eventually, it is said that you attain nirvana when you come to terms with the insignificance of your being. That is the hardest concept to me, I don’t know if I want to reach there. How can it be insignificant? But, lets not jump the guns. I am happy knowing that I am at the point where I know my ignorances. Where I know what I can never be and I’m at peace with it. It lets me enjoy what I am.

Thanks to a friend for passing this wonderful post - http://alexmaccaw.co.uk/posts/traveling_writing_programming
I want to do this too. I have already started writing the book I always wanted to, I hope the traveling can begin soon too.

Then, I love this video from my friends at Holstee -

And finally, this gem of talk by Elizabeth Gilbert that I bumped on quite accidentally. Frankly, I started writing after watching this -

And, let me end with what she says at the end -

Don’t be daunted. Just do your job. Continue to show up for your piece of it, whatever that might be. If your job is to dance, do your dance. If the divine, cockeyed genius assigned to your case decides to let some sort of wonderment be glimpsed, for just one moment through your efforts, then “Ole!” And if not, do your dance anyhow. And “Ole!” to you, nonetheless. I believe this and I feel that we must teach it. “Ole!” to you, nonetheless, just for having the sheer human love and stubbornness to keep showing up.

Posted in Musings | Tagged | 5 Comments

Silent waters

A shot from Wyckoff Environmental Reserve (via instagram)

Photos say it better at times.

Posted in Musings | Leave a comment