Python – Difference between “.append()” and “+= []”

In my new Django project, I was trying to append a list of tuples (which contained more than 1 tuple in it) into another list of tuples. Then I got this error: ValueError: too many values to unpack (expected 2) I was using .append() method to perform this operation and apparently that is exactly where the problem […]

Django Error – django.db.utils.OperationalError: no such table

Django “no such table” error of death.. I recently encountered this “no such table” error while trying to run makemigrations command on PyCharm. I dropped database tables related to my app, cleaned django_migrations table for this app, cleared migrations folder as described in this post: Then I ran makemigrations… No such table.. I did lots of […]

Django’s Templating System

Django is a web development framework built on Python language. It provides many useful features and libraries for building websites quickly. In this post, I wanna talk about Django’s templating system. Do you know what MVC is? MVC means Model-View-Controller. It is a pattern widely used by developers for web development and application development. The main […]

Can’t find ‘__main__’ module in ” – Python (Sublime Text 3)

This is the easiest one, don’t panic. I think you forgot to save your file first 🙂 🙂 Just save your Python script with .py extension and run it again. It should work this time. Assuming you have successfully: Installed Sublime Text 3, Installed your version of Python, Created your Python.sublime-build file, Added your “path” variable. For […]