Codementor Events

How I learned Django

Published Jul 27, 2018
How I learned Django

About me

I'm Mohammad Hossein Mojtahedi. I've been developing and designing since 2004. I have tried most of my life to both be analytical and artistic at the same time so that I can make the best decisions at any given time.

Why I wanted to learn Django

Because at the time there were not enough Persian resources for WordPress, PHP's syntax made me crazy and even I didn't understand MVC back then, WordPress themes looked extremely messy to me. So I wanted to create my own set of tools to deal with clients and charge them more.

How I approached learning Django

At first, I used the poll and vote tutorial taught by Django's documentation to teach myself a thing or two about how Django works. Then I tried for a couple of months to learn how to deploy Django projects the efficient way. In the meantime, I learned about Git and pretty soon I was asked to design and develop a project that took me a year to complete because the guy behind the idea didn't trust anybody else.

Youtube, Stackoverflow, Google and a couple of learning sites were always there for me. RealPython, DjangoGirls and some other websites were amazing but when it came to understaning what UTF-8 is, how to store emojies in the database, the differences of NoSQL and SQL, the security of a website, modern UX/UI trends and more, I had to go beyond these sites and search for the best resources that I've bookmarked and can definitely help you.

Challenges I faced

The 1-year long project that I talked about earlier made me go through an entire book to extract 150 algorithms to detect illnesses in adults, men, women, and children. It was an experience that I finally fully grasped what JSONs are, how you can integrate JS with Django, how to deal with a client that askes you to be present at the company and have meetings every week (Yup! seriously. Every week)

Since I live in Iran, we don't have access to Visa Card, Master Card, PayPal, Stripe and other cool online payment methods. We have our own and the banking system is different. There is a central site called Shaparak where everybody fills their card info into its form and submit.

The problem is that in Iran there are only 2 programming languages respected enough to have packages ready to install for Shaparak system: PHP and DotNet. For other languages, you have to write them yourself. Writing this package/app for Django was quiet challenging because some of the tools that I had to use were pretty old hadn't been updated for a couple of years. So it took a looong time to read PayPal and Stripe's packages to understand how to do it securely.

And some other crazy challenges that made my life easier after I was done with them.

Key takeaways

Around 98% percent of your problems have already been solved by someone on the other side of the planet and are out there. Sometimes you need to be creative to find them. Before asking questions, make sure you search for your problems thoroughly.

And also never just copy / paste a solution from the internet. Sometimes there are Zero-Width hidden charectars that might mess you up for an entire day. For fixing this issue you can also use a better font for your IDE that shows squares for Zero-Width characters.

Tips and advice

  • Sign up for a couple of newsletters about Django and Python so you will be up-to-date.
  • Python's syntax is the simplest. Django's MTV (Model, Template, View) is simple and amazing and helps you learn faster.
  • Go for Python 3 and Django 2.
  • Use DevDocs.io for a simple local offline searchable documentation.

Final thoughts and next steps

Take an existing idea and try to recreate it for your own good. You might never publish it or even use it. But because of the problems and challenges that you have to solve during this project, you'll learn more and more.

And remember this:

Django and every other frameworks or programming languages or IDEs are just tools. You don't use a shovel to add sugar to your tea and you don't use a fork to fight a dragon. Don't get attached to them. Learn a couple of them use them wisely. And know that there is no finish line in science. You should alwasy learn more and more.

Discover and read more posts from Mohammad Hossein Mojtahedi
get started
post commentsBe the first to share your opinion
Show more replies