How to Learn Django (2020)
Tags: django, python, tutorial, beginners
Published: 2020-06-21 20:05:04

As a “batteries-included” web framework, Django comes with a host of built-in features and a correspondingly steep learning curve for newcomers. In this post, I discuss what you need to know _before_ giving Django a proper go and links to recommended resources.

## HTML/CSS
Web pages are made out of HTML and CSS. Knowing how to build and deploy static websites is **highly recommended** before embarking on an attempt at Django. Fortunately, there are several good free resources available including [FreeCodeCamp](https://www.freecodecamp.org/); Shay How’s [Learn to Code HTML & CSS](https://learn.shayhowe.com/) series, and [HTML & CSS is Hard](https://www.internetingishard.com/html-and-css/).

HTML itself is not _that_ deep a topic. You can learn the basics in a day and master most of you’ll need within a week. CSS is, unfortunately, far more complex. You don’t need to become a CSS expert, but you should know how it interacts with HTML and be able to style your static websites somewhat. In practice, most developers rely on a CSS framework like [Bootstrap](https://getbootstrap.com/) or [Tailwind](https://tailwindcss.com/), and in companies Django developers typically don’t touch the front-end at all, so a basic understanding is all that you need.

## World Wide Web
It’s necessary to also have a fundamental understanding of how the World Wide Web actually works. Mozilla has probably the best guide called [How the Web works](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/How_the_Web_works) which is part of its larger, and also recommended, [Learn Web Development](https://developer.mozilla.org/en-US/docs/Learn) series.

## Python
Django is written entirely in the Python programming language so it shouldn’t be surprising that Python knowledge is part of the list of prerequisites. The question, though, is how much Python do you need to know? Obviously the more the better but I would argue you don’t need to be a Python expert to use Django. At a minimum, you should understand how to install Python packages (like Django), use a virtual environment, imports, and classes. [RealPython](https://realpython.com/) is a popular source of Python tutorials but if you’re looking for a book, [Python Crash Course](https://amzn.to/2okggMH) covers the basics and is enough background to embark on Django itself.

## Databases & SQL
A database-driven website relies on, well, databases so you should have a basic understanding of how SQL works as well as database design principles. [Khan Academy](https://www.khanacademy.org/computing/computer-programming/sql) has a free guide to SQL and this site has a [Database Design Tutorial for Beginners](https://learndjango.com/tutorials/database-design-tutorial-beginners) that is also worth reading to understand primary keys, one-to-many relationships, and database normalization.

When using Django itself, the ORM abstracts away the need to write raw SQL but understanding how databases work becomes increasingly essential as websites grow in size.

## Git 
The final prerequisite is knowledge of Git, the version control system you’ll use on every project. It’s not technically part of Django but you’ll use it on any serious side or professional project. Github has a [Git Handbook](https://guides.github.com/introduction/git-handbook/) that is a good first step. You should understand how to install git on a new repository, make commits, and push/pull code to a remote repository either GitHub, GitLab, or BitBucket most likely.

## Django Tutorials
Finally we come to Django itself whose official docs feature a [Start](https://www.djangoproject.com/start/) page. The official [Polls tutorial](https://docs.djangoproject.com/en/dev/intro/tutorial01/) is a good place to start but is not a friendly welcome for those new to web development with frameworks. It does not cover how to install Python or deploy your site to the internet, and goes in-depth on some areas of Django itself.

If you find the official tutorial too much, a gentler introduction can be found in the [Django Girls tutorial](https://tutorial.djangogirls.org/en/) on building and deploying a blog, or the sample chapters of [Django for Beginners](https://djangoforbeginners.com) which cover the building of three Django sites. Mozilla also has a comprehensive though slightly more advanced [guide to Django](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django).

## Books
For a book-length treatment, [Django for Beginners](https://djangoforbeginners.com) and [Django Crash Course](https://www.feldroy.com/products/django-crash-course) are friendly beginner treatments. For intermediate/advanced coverage, [Two Scoops of Django](https://www.feldroy.com/products/two-scoops-of-django-3-x), Django for Professionals(https://djangoforprofessionals.com), and [Speed Up Your Django Tests](https://gumroad.com/l/suydt) are recommended.

## Videos
There are many YouTube videos on Django and the quality varies considerably. Solid options include [Corey Schafer’s series](https://www.youtube.com/watch?v=UmljXZIypDc) as well as those by [Traversy Media](https://youtu.be/e1IyzVyrLSU). For a paid option, [JustDjango](https://justdjango.com/) is quality content.

## Podcasts
At the moment, there is only one weekly podcast on Django called [Django Chat](https://djangochat.com/), hosted by the creator of LearnDjango.com and a Django Fellow, Carlton Gibson. [Django Riffs](https://www.mattlayman.com/django-riffs/) is a budding series and [Running in Production](https://runninginproduction.com/tags/django) often features Django-specific content.

## Conferences & Meetups
The best way to learn more and become involved in the community is to attend either a DjangoCon or local Meetup. [DjangoCon US](https://2021.djangocon.us/) has been delayed until 2021 although [DjangoCon Africa](https://2020.djangocon.africa/) is scheduled for November, and both [DjangoConEurope](https://2020.djangocon.eu/) and [PyCon Australia](https://2020.pycon.org.au/) are holding virtual conferences. In addition, there are Django meetups in most major cities that meet monthly and even, these days, virtually.

## Django Forum
If you’re stuck on a Django issue, Stack Overflow is always an option but a newer one is the official [Django Forum](https://forum.djangoproject.com/) which has a wealth of good advice from experts in the community.

## Conclusion
Ultimately, learning Django is a constant endeavor. The framework continues to evolve as does the broader World Wide Web, most notably with the current introduction of Async features in Django 3.0+. With a major new release [scheduled for every 9 months](https://www.djangoproject.com/download/), there’s never been a better time to learn Django.