My Django Journey

I have been wanting to put this together for over a year now. This is a collection of great blogs, tips, tricks, tutorials, how-to-s that helped me go from an absolute Django noob to setting up a full fledged website (solely depending on them).

I have benefited tremendously from open source software as a student and as a professional. Here is a very small effort to acknowledge everything that helped me on, as the title suggests, my Django journey.

This post is for noobs, first time users and/or developers who are considering Django among their options to set up a website.

<On a side note, I have always questioned the use(lessness) of taglines for marketing, but Django comes with a beautiful tagline, ‘For Perfectionists with Deadlines’. I really couldn’t resist checking Django out after that 🙂 >

First off, if you are a web developer and in the decision phase for choosing the framework/stack that you want to use, IBM has an excellent overview of Django. This will give you a quick view of the backend code, the code structure and a few tools that you would have to dabble in from start to finish, without having to do any experimentation of your own. This link is meant for developers and for somebody who has requisite technical knowledge to judge a framework on technical grounds.

However, don’t get worried if you don’t find yourself in that category. If you are an absolute noob who finds oneself in the situation of having to set up a cool website, there is no need to worry at all. You can kickstart on the right foot by completing this great MOOC on Udacity: Web Development.This will require some good time investment but its totally worth it.

If you have decided on Django, then dive in:

This is the best and most succinct page I have ever come across on starting a Django project. It is an absolute MUST FOLLOW. Even if there is nothing else in this post that you read or use, this one link can take you very far in doing things the ‘right’ way. A recent update for Django 1.6 from the same author is here.

At this stage you should have a good idea of everything that you need in terms of software components and the major milestones you will have to accomplish to get your website up and running.

While the Django tutorial allows you to do away with the hassles of databases and servers, obviously, real life is not like that. Which is why Link (1) is so important as it outlines steps to make real life hassle free.

I will go ahead and emphasize something more here. It is quite common to not think of servers and deployment in the initial stages. That is not such a good idea. You should think of deployment from day zero for 2 reasons. 1) You will focus on designing your code for deployment and that will make life easy towards the completion of your project. 2) If you deploy your code early, you can have a good idea of how the website will look to the world and also demonstrate your progress to others during development itself. In that spirit here are 2 links:

  • Top 10 tips for a new Django Developer– You will/should keep coming back to this page during development to make your project as portable as possible and for smooth transition between servers, etc.

If all this is too much for you (tl;dr, didn’t understand etc), there is atleast one tip that I highly recommend. It worked great for me, even during development: A BASE_URL Template Variable in Django.

Enough of deployment (for now). Lets get back to the actual tools.

Link (1) covers this tool but I will mention it again because it was of tremendous help to me during development. I could manage my database and schema growth smoothly with this tool, which otherwise can be quite nightmarish during development. They also have some very nice and brief tutorials to get you up and running in a matter of minutes here. Again an absolute MUST HAVE.
(For starters you will never face this irritating error ever).

I chose to go with postgresql for the database and set it up using this short bunch of steps. I cannot find this cool blog online anymore so I have uploaded a pdf of the saved page. A few more helpful (almost MUST-KNOW) links for postgresql:

For the server, I chose to go with Apache. Some helpful links:

I am excited about this section. Some cool developer tips that made things really efficient and less annoying:

Django Specific

Although the django documentation is extensive and helpful, it is lacking w.r.t these specific tasks, which can be quite confusing for a newbie:

UI/UX- Using django-widget-tweaks made my life easier

Finally deployment- I chose to go with Linode. Read this blog + comprehensive guides of Linode and you should be good to go.

If you have made it this far into the post, then here are a few bonus pointers:

So well, without much ado, I will end this post now.

If you are wondering, where is the website that I worked on? I used Django to make an online game to simulate a financial environment for the students of London Business School. I am currently working to release this game under a GNU GPL license. If that goes through, I will update this post with the link and would be happy to receive some reviews. In the meanwhile, I hope these links will help someone as much as they helped me.

Code on!

(*)- In my experience I have not found Django’s FormWizard to be very helpful. After trying it once I stuck to designing and coding in multi-step forms on my own.

 

Of Colour, Minutiae & Madhubani

In my last post I had briefly described how the brilliant art centre at Sahyadri School enabled me to explore various art techniques from around the globe. But as I was putting together and cataloguing my work for this piece, I realized that my connection with artistic expression stems from a time much earlier than that.

A set of pastel crayons are in general owned by every kid in school these days. In a small hobby class which I attended under Varsha Trivedi, I was encouraged to have fun with pastels ( a far cry from the drab art ‘period’ in school) . She helped us to discover that one could mix and match seemingly different hard colours to create interesting and aesthetic effects on paper. It was with pastels and not fluid colours that I first discovered the effects of combining shades.

In India colour is an important underlying theme in festivals. In Diwali, a festival that I love and enjoy the most, making Rangolis is a common custom. Having enjoyed making Rangolis from a very young age, I decided to combine my experiments in pastel shade mixing with rangoli design styles.

RangoliPastelsAakshaMeghawat

I also experimented with  symmetry, geometric designs and not mixing shades but keeping colors of similar tones side by side.

DesignAakshaMeghawat

This was geometry on a large scale but I love intricate designs. And one day I found myself making this:
MinuteAakshaMeghawat

It was natural that I would combine the 2, colour and minutiae:

CombinationMeghawat2

CombinationMeghawat

At Sahyadri we had a small workshop conducted by a native of Madhuban village. I was delighted to discover that my obsession with minutiae was also captured in a beautiful folk art known as Madhubani. While it was an interesting experience to learn from someone who was not fluent in English or Hindi, we still managed to learn a lot and experienced how the smallest and simplest of shapes can look so beautiful when they come together.

MadhubaniAakshaMeghawat

 

Madhubani2

Simple colours, simple shapes, intricate minutiae, folksy madhubani………….

 

Warrior in a Pink Sari- Excerpts

The international and Indian media has failed to represent women in non-conventional roles. While the list of atrocities, crimes, subjugation and discrimination against women is endless and keeps expanding, the cultural, religious and even spiritual representation of women mostly just helps to add fuel to the fire.

I do not like to delve in this  because it is an endless abyss of disappointment that gets me nowhere. I cannot look to history, traditions or culture for anything. And by anything I mean everything, whether its more understanding, a solution or any form of objective assessment of issues etc.

Why this matter of representation bothers me the most is because of the plain hypocrisy in our culture that I cannot stop witnessing while most others fail to even notice its existence. For example, India has been shocked into a pathetic realization about where women stand in our society with the horrific rape incidents that are thrown at us every few months. But a worse realization for me is the hypocrisy in our society which is so entrenched that the same people who express staunch opposition for such acts, lose no time in queuing up for bollywood movies such as ‘Dhoom3’ etc filled with item songs and female actresses whose only roles are to wear short clothes, dance around and basically test/entice the audience’s libido.

This is why it was a much needed and welcome relief when my father gave me ‘Warrior in a Pink Sari’- Sampat Pal.

Although media and history love hyping up figures and creating larger than life characters, it is very rare that I have felt such a sense of heroism that I have experienced after reading this book. Even if Sampat Pal were not a woman, I would have been inspired to write about her for the sheer inherent awesomeness that she displays in her simple words and arguments. Oh and I cannot even begin to outline the awesomeness of her actions.

But she is a woman, and the kind of awesome woman who is missing from our society, who is not talked about in our media, and who has mostly never found a place in history(or for that matter in our religion). But her voice needs to be heard(**).

‘The Gulabi gang named for the pink uniform worn by its members, rose to fame between 2006-2007, very soon after it was formed. It came up as a vigilante women’s group who took upon itself the formidable task of battling the three pillars of Indian society- patriarchy, caste and corruption- in the Banda district of Uttar Pradesh. Dressed in Pink Saris with sticks in their hands, these women would march to the police station or the district magistrate’s office and demand justice for other women  who suffered domestic violence and MEN who were victims of caste discrimination and corruption. The woman who clad them in pink and handed them the lathis was their leader- Sampat Devi Pal.'(*1. On why she chose the colour Pink)

Sampat Devi Pal was born in the village of Kairi. At the age of eight she secretly managed to attend school but had to stop two years later on being discovered. She was never able to take up formal education ever again in life. To this day she remains illiterate, (an adjective she gets deeply offended by). She was married at age 12 and by 20, had had 5 kids. Despite all this and more, it is amazing that she has created so much impact and has been able to come up with such articulate arguments that have inspired many others like her to unite in her cause. (*2.Sampat Pal in her own words).

In an irony of sorts, her story first came out as a French book by Anne Berthod. It was only four years later that it was transalated in English. An irony that Sampat Pal herself recognizes(2nd last paragraph of this article).

What follows are a few paragraphs that struck me the most in the book. So without further ado, presenting to you excerpts from the book, the pure awesomeness that is Sampat Pal:

“Look at the swear words or the gaalis  for example. Why are they always about women? Behenchod (sisterfucker),  matherchod  (motherfucker), betichod (daughterfucker). Take any crude expression and its always about women. The other day I was asked to settle  a conflict between two brothers who were tearing each other to shreds because one brother’s goat was grazing in the other’s field. The argument became more heated. One called the other behenchod. What did his sister have to do with his goat? The other replied, ‘Matherchod!’. What was that all about? Those two idiots had the same mother! It never occurred to them that they were insulting their own sister and mother, the woman who brought them into the world. It was ridiculous!”

Mahabharata is a Hindu epic of the struggle between the Pandavas and the Kauravas. Draupadi was the wife to all the five pandavas ( Yudhishtir, the eldest Pandava lost her to the Kauravas in a game of dice and then Dushasana,the 2nd eldest Kaurava tried to strip her in full view of the entire assembly. Draupadi returned to Pandavas, dishonored. Pandavas raged an epic battle against the Kauravas after 13 years of exile to regain their kingdom and honor*3).

“I’ve thought a great deal about the Mahabharatha. Even at the beginning of everything, there was a woman. She was the main stake. Thousands of men killed each other over her. And why? In reality neither the Pandavas, who gambled her as a stake in a dice game as if she were some old horse, nor the Kauravas who wanted her to belong to them showed her any respect. The whole business was primarily about power. 4000 years later men haven’t changed a bit. They are still tyrannical, want to control everything and impose their domination, even when they are weak and full of vices. They gamble away their salaries, drink alcohol and beat up their wives. Worse still, many of them go looking for work in the cities and stay away for months to fulfill their mission. During this time, to forget how lonely they are, they get drunk and sleep with prostitutes, and when they eventually come home, they bring back diseases with them. Thats how AIDS began to spread in the villages.”

“When we got married, my husband used to smoke ganja. When we first arrived in Badausa, during the time he was out of work, he would be sitting in the courtyard of our house, puffing on his pipe all day long and doing nothing else. He was wrecking his health. I couldn’t stand the sight of his dazed eyes and constant apathy. So I forced him to stop. I’ve always tried to get him to make an effort. We used to argue all the time because he didn’t want to work harder. At that time I was the one bringing in the  money, looking after our family, taking care of the children as well as the house. Yet Munni Lal never missed an opportunity to present himself as the head of the family.”

“This is the paradox in the male dominated society, which is so humiliating for women. Women are despised and relegated to an inferior status and yet it is they who actually wear the pants in the house. They see to everything-the children, the housework, cooking and washing, and even the household accounts. In Rauli no one argued with my mother-in-law’s decisions, not even my father-in-law. That creep forced me to marry off my daughters at a very early age, but he never dared raise his voice against his wife.  Men’s bravery is all show. In reality they’re cowards. Most of them are selfish and act only in their own interests. Take my husband for example. He approves of my work and gives me moral support, but he refuses to do any more than that. He says it’s because he is a simple man who can’t take initiative. To listen to him you’d think that all he wants is for me to tell him what to do. What dishonesty! If I ask him to come with me to my village, he always finds some excuse not to come. Infact he is not really interested in my work. What I do is beyond him.”

“I’m also wary of ‘charismatic leaders’ whose glory obscures the contributions of thousands of anonymous workers on the ground who are less well known, but probably more effective. Take Dr. B.R. Ambedkar, for example. He’s dead now, but everyone still regards him as the patron saint of Dalits. In 1950 Nehru asked him to draw up the first Indian constitution, a text that enshrines the Dalit’s right to education and prohibition of discrimination against Dalits and women. Today though he is presented as the sole author of the text, he didnt write it all by himself. He headed a commission of several hundred people who all made suggestions and fought to get their ideas included. But the collective memory has forgotten all those people, remembering only the name of Dr. Ambedkar. Thats unfair.”

“At the moment the only donations I’ve received have come from foreign journalists visiting me from the US, the UK, France, Italy and Korea. However, the press in my own country has take little interest in me. I’m aware that the recognition of my work by Indians will only come via the  international scene. If the biologist Hargobind Khorana hadn’t emigrated to the United States, he never would have won the Nobel Prize in 1968 and would never have become famous in India. This is also why I agreed to write this book. And then, like all those travellers who come here from far ends of the earth, I too dream of travelling to other countries, exploring new horizons. My publisher has promised to bring me to Paris and I just cant wait! I would love to talk to French women, to tell them that despite our cultural and linguistic differences, women have the same problem on every continent. I’ve even heard there’s a replica of the Statue of Liberty in Paris. If ever I have the chance to see it, I’ll prostrate myself before it and pray for the liberation of all the women in India who are held prisoner by invisible chains that are stronger than titanium”.

For a complete picture of the things she has done to take on injustice, from threatening police inspectors to beating up thugs to forcing district magistrates to resign, one will of course have to read the book. She is a woman of action but her insight and her powerful inner voice were what struck me the most.

P.S.

If you aren’t tired of reading, here are the asterisks explained:

*1. “It was just a matter of choosing a common colour. Bapuji first opted for blue but that was the official color of the Bahujan Samaj Party(BSP). Then we thought of yellow or orange but that was too reminiscent of Sadhus and Pandits. Green and white are often worn by Congress volunteers and red is used by Samajwadi Party. The only colour remaining was pink, one that was commonly found and remained exclusive to women. It was easy to find any woman’s wardrobe. Most women would be able to afford it.

*2. “There’s nothing exceptional about me and I haven’t suffered more than the rest. Born into a poor family from one of the most despised castes and with no education, I’m just a woman like millions of others in India. My marriage and my husband were imposed on me and for a long time I submitted to the ways of my world. Like so many others I could have become a victim. But one day I said no to the law of men. It wasnt easy but I managed to choose my own life. Today Im the leader of the gang and I defend all victims of injustice: the despised, the poor, the exploited, victims of corruption. I know my cause is just and that certainty strips me of my fear. Im not impressed by authority. I’ll put a police inspector in his place just as soon as I’ll lecture a sheperd from my own caste. Physically I’m not very big but I have a solid constitution. I have a powerful voice and people listen to me. I am a woman and to make myself heard I have to make more noise than the rest-peacefully whenever possible, and with the help of my fists if I must.”

*3. For an excellent analysis of this event, one can read about the same in Gurcharan Das’ ‘The Difficulty of Being Good’.

** Just before I started writing this article, I caught the trailer of ‘Gulaab Gang’ on youtube. But then I came across this, ‘Initially, it was reported that the Bollywood film, Gulaab Gang, starring Madhuri Dixit and Juhi Chawla as leads, is based on Sampat Pal’s life, but the director denied this, saying that he is obliged to her work but the movie is not based on her life.’  And because Bollywood in general does not fail to disappoint, so much for that.

The Buddha Theme

Buddha Close-up Batik

I was an artist before I became an engineer.

This was possible because of the brilliant art centre set up at Sahyadri School where I had the opportunity to explore several artistic cultures and techniques. In my 2nd year of this exploration, I found myself very inspired by Asian art revolving around the Buddha. Having worked on a batik piece, creating ‘Mohini’, I decided at the time to create a Buddha image not with a paint brush and paints, but with a batik spindle, wax and dye-colours.

Batik is a traditional Javanese technique in which selected areas of cloth are blocked out by brushing or drawing hot wax over them, and the cloth is then dyed. The parts covered in wax resist the dye and remain the original colour.  We start with the lightest colors working toward the darkest colors waxing the front and back and the front again for each new dye color used. When we are finished with this process, we put the fabric in boiling water and melt the wax off. This is the time the wax ‘cracks’ and gives the charactersitic batik effect to the cloth.

The challenge here was that I wanted to sketch the outline of the buddha directly with the hot wax canting. After a month of studying, sketching and getting familiar with the lines and figures of Thai Buddha, I began work on this piece. Another month of careful waxing, dyeing and boiling later:

Buddha (Batik)

The flowing lines of the Buddha’s garb and to create shades using dyeing in the garb as well as the lotus flower petals was challenging but also great fun.

Buddha Close-up 2 Batik

WITHIN

What am I?

A state of mind

A situation

An occurrence

A floating leaf in the flowing river

A speck in the great rush

A draft in the making

An event in the rolling time

To subject my energy to the vagaries

My soul to the torment

My tranquillity to attachment

My purpose to an outcome

My resilience to results

My path to the wilderness of others

Myself to judgement

This subjection, dilution, estrangement……..

Simply no more, simply no more.

On Inspiration and Entrepreneurship

This post is inspired from ‘The Social Network’. Before you read on, if there is a thought lurking somewhere in your mind that here’s another article singing a song of facebook, joining in hundreds of people doing the same thing all over the world, well then no, not really.

Today I want to think about what really strikes people. There is always something about inspiring people. Is it their rebelliousness? Is it standing out? Any passionate work of mind and spirit encourages copy cats, why?

If it was simply success that induced admirers, then we all would want to be ideal. Because then we would have to conform to metrics set in place by others.

It is not money or marks but its Respect, Envy and Revolution that drive the world.

Because it is not numbers, it is not rules and mundane awards that drive the world. It is not the conventions, standards, it is not even the unconventional, the rule breakers who drive the world. Not rule breaking for the sake of it.

It is originality that drives the world. Passion, love drive the world.

Real success not only generates respect, crazy unjustified downright blind following, admiration, sycophancy. It also generates mockery. People either hate you or love you, they go crazy in your passion and energy in either a good way or bad, but they go crazy because its all about passion.

And why do some things drive people crazy. Because at the end of the day everybody wants to fall in love with somebody or something, wants hope and a reason, to wake up to a purpose. Because it is not enough to breathe and eat and think. Life is not that, life is passion, it is love and dedication.

Why does anybody want a purpose to wake up to? Why do you want hope and a reason? Because possibly that is the only way of finding your centre and your confidence.

General Douglas MacArthur once walked through gun fire right on the battle field. As he embarked a second time to repeat the same feat, he asked a petrified soldier to accompany him. On being questioned as to how he could walk through gunshots with so much confidence, he laughed saying,” I will not be killed by these gun shots. I still have my purpose to fulfil.” The young soldier immediately replied, “Sir I have no such purpose in life to live up to.”

Confidence and conviction. Because sometimes you just know that you are right, because there’s no reason, because you know the universe will conspire not against you but for you.

It is all about living to the fullest. It is about being 100% of one thing, putting everything at stake, dreaming.

Entrepreneurship is not a modern day business concept, it’s a way of life, it’s a way of living that you choose in which you choose yourself over everybody else. You recognize your own individuality in the highest possible form (you give your own individuality the highest possible recognition), to give the best and the most of everything you have to one thing. And therefore even a seemingly non entrepreneurial activity can be entrepreneurial and sometimes starting your own enterprise can also not be entrepreneurial.

In the movie, Sean Parker said, “the record companies beat me but only in court”. He represented something that had defied all regulations but he represented something real. He was perhaps a non conformer.

There is no reason for you to think that this is radical.

And possibly the most critical point is to realize also that non conformity is not the way or a solution. This is not a call to drop everything you are doing, or surrender yourself to the unknown or disobey all the rules for the sake of it. But it’s a call to ask you to wake up, to live more, to be 100% more in everything you do.

If you want to be a non conformer, then be one but with full integrity. You want to break rules, break them but break them well. You want to destroy, do so but destroy well.

So what should you do? Ultimately what matters and what doesn’t? Do marks matter? Does popularity matter, do friends matter? Or don’t matter?

Should you drop out and wait for that spark or brilliant idea to come along? Not really. Be happy, do the things you like. Make sure you have no regrets and that you are happy with everything going on in your life. That’s all.

Learn to applaud the winners but do not forget the losers. Because there will be many losers who will be as good or even better than the winner and so learn to appreciate them. Remember ultimately that winning is fun but its not always beautiful and infact more often way more ugly before it becomes close to becoming anything beautiful. Accept the fact that people will work harder to loot, steal your ideas, work and achievements prior to and rather than acknowledging or appreciating you. That this is the ugly fact life.

Life is way more beautiful and way uglier than you can imagine, and you in all probability have no idea of the degree of its beauty or ugliness. That the most important thing is to keep an open mind, to be humble and never ride too high or too low. That there is scope to be happy and sad in almost any situation. And you have control of your life in ways you have not realized and you do not have control of your life in ways you might be tricked into believing.

That everything is confusing and because of that everything is also very clear. It is very complex and hence very simple.

Intense

Winston Churchill once said, ” From intense complexities emerge intense simplicities.” The veracity of that is realized when life thrusts you into a quandary. A quandary of sorts. When the mind cannot any longer comprehend one’s situation or how one got there. When all reasoning and implications are either insufficient or turned on their head.

Then the mind stops thinking.

It is only when you face heat that your mind distills. It is only then that you realize how unimportant judgments and classifications can be. That the illusion of control over your life is just that, an illusion.

It is only then that objectivity rises. The acceptance and the realization of what is and not just what one wants it to be.

In that bottom emptiness when you cannot bottom out further, only then can you resolve yourself. Then you are bare. In that difficult moment the elements that made you stand out. Your dependence, your nature. And even though you are an individual, suddenly your individuality is resolved. The smallest of elements that were not even considered to be participants in making you come out. Only then can you see your beliefs.

Every event in your life that presents you with an opportunity to bottom out, the pressure, the risk, the extreme, there is the risk that you will break down or enter a higher orbit. But more importantly that is also the only opportunity when you will have to resort to objectivity. And due to that compulsion objective you do become.

If you enter that higher orbit, from then on the taste of that exaltation pulls you further and further more to enter higher orbits. All your actions, your mind’s decisions drag you, pull you, attract you towards entering that higher orbit.

And if one does it for long enough, it gradually become’s one’s nature. The natural becomes indistinguishable from the forced. The world and even oneself begins to believe that this is me, that I am this.

Such are the heroes of the world, admired for their nature, for their detachment and lack of dependence.

But if you do not enter that higher orbit, you breakdown. All beliefs are discarded even if just temporarily. There is no attraction, no pull, no push, just you and the present. You and the now. Then the mind is jabbering, frantically trying to find a set of beliefs, a source to cling on to but you do not want (even if just for a while) to be pulled back into anything. Because you are tired of believing, tired of judgment, tired of your own attractions.
It is only in that complex descent that you have the chance to redefine your metrics, your beliefs.

And you have to believe in something because existence demands that. Presence of hope is life and its absence is death.

Once again you enter the cycle hoping that you may not break again, hoping that you will enter the higher orbit.

In those moments of redefinition one can be a curious mix of vulnerability and strength. Strength against the old and vulnerable to the new.But it is that vulnerable side which decides your course from then on. What you give into in that vulnerability is what your future will be.

And then someday in the future when you do look back, you are but a product of the metrics and definitions you chose for yourself that day. You may consider yourself to be wrong or you may consider yourself to be right but all you will be is not something right or wrong, but simply a product of your choices, definitions and metrics.