Skip to content

Latest commit

 

History

History
113 lines (82 loc) · 4.97 KB

django.md

File metadata and controls

113 lines (82 loc) · 4.97 KB

Learning Django

by Eklavya Sharma

This post is mainly targeted for people who want to learn Django.

Here I have written how I learned python and Django and which resources and tutorials I used.

Why learn Django?

  1. You will be able to write code for backend for events in BITS-ACM. Working with others and handling an event will teach you a lot.
  2. This is a place where you can put your knowledge of python to practical use. This will also increase your knowledge of python. When I worked on a big Django project, I learned a lot.

How much python should one learn to start Django?

There are 2 types of people:

  1. People who only learn basics of python and quickly move on to Django
  2. People who learn python in great detail and only then start Django.

You will find successful people from both categories. I am the second type. I think it is necessary to learn python in detail because all the code you write for Django will be in python. Sometimes it is easier to do things the advanced way (why else would advanced features exist in python?).

You should have a strong grasp on loops, functions and structured data-types (like lists, tuples, strings, dicts).

You need to know the basics of classes (you must at least know about inheritance). You should also know basics of exceptions (how to catch and throw them). You should also know how to import modules and use functions from them.

The most complete and detailed tutorial I know for python is the official python tutorial. However I feel that is not the right place to start.

Pick up some online course or something else to start. I started with Google python class.

After that, at least skim through the official tutorial. That will make sure you have not missed out on anything useful.

Python 2 or 3?

Between python 2 and 3, I recommend that you do both but focus more on python 3. Doing both won't be a problem since there are very few differences between these versions. Learning python 3 is important because python 3 is better and will eventually replace python 2. Learning python 2 is important because many python tutorials and Django tutorials use python 2.

How to practice python?

How good you are at python will mainly depend on how much you have practiced.

If you are following an online course, they will have exercises. Google python classes don't have many exercises. Since I was interested in competitive programming, I started solving competitive programming problems in python. I think that is one of the best ways to practice.

HTML

You must know HTML for Django. It'll be good if you know CSS as well, but that's optional. I learned them both from Codecademy.

How to start Django

I'll recommend Tango with Django. You only need to do the first 10 chapters. Rest of the chapters are not very useful.

You might find it difficult to start if you don't know about the HTTP protocol (I started without explicitly learning it). This article by zapier explains the HTTP protocol. (Actually this article is part of a series on learning APIs, but you can still read it). (APIs are interesting and useful, so might as well read the whole series)

After you have done Tango with Django, you should look at the official Django tutorial.

After this you should make a website on your own. You might realize that you need to refer to tutorials again-and-again. Sometimes I still need to look at them. There's no problem in doing that in my opinion.

These tutorials I have mentioned above barely scratch the surface. Django is HUGE. VERY HUGE! Fortunately djangoproject has documented everything well. This page tells you how stuff is organized on this site. It's important to know this, since you will be visiting this site very frequently when making a website on your own.

While you are working on your website, this is a very good opportunity to learn Git. Git is very useful for collaboration. Since many people will be working on an event simultaneously during APOGEE, it is very important to know Git. Git Tower has a good tutorial for Git.

You'll realize that your websites don't look very good if you haven't mastered HTML and CSS. You can learn Bootstrap in a few days. Bootstrap is a CSS framework. It is very easy to use and will make your websites look awesome even without writing a single line of CSS. W3Schools has a good tutorial on Bootstrap.

What next

I might have a few simple projects in Django you can contribute to. You can find them on my Github page.