Python SimpleHTTPServer

python-simplehttpserver

Python’s SimpleHTTPServer is very lightweight and very useful. If you want to share files from your localhost or if you want a quick web server without messing with setting up apache or something similar SimpleHTTPServer is here for you. All you

Read More Python SimpleHTTPServer

Python – Difference Between “is” and “==” (double equals)

Python - Difference Between is and double equals

This may be a point where a lot of you may get confused. I see some people using them in if conditions without actually knowing what they do. Let me try to explain the concept with a couple of lines of

Read More Python – Difference Between “is” and “==” (double equals)

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

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

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

django-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

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

Python – Single Line For Loops (List Comprehensions)

django-list-comprehensions

In Python there is a very simple and elegant way of defining a for loop in a single line. Thing is, not only can you define this for loop but you can also use the values in this loop to

Read More Python – Single Line For Loops (List Comprehensions)

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

Read More Django’s Templating System

When Link is Clicked View Loads but URL Does not Change – Django on Cloud9 (c9.io)

Ok. So my new learning path includes Python and Django (which is also Python 🙂 ). I thought to myself, why not do some learning/ coding on one of the cloud IDEs like cloud9 (c9.io) or koding (koding.com) and started

Read More When Link is Clicked View Loads but URL Does not Change – Django on Cloud9 (c9.io)

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

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

Sublime Text 3 Error – ‘python’ is not recognized as an internal or external command

I will soon start my study on Python while developing my latest website using PHP. This time I wanted to use a different editor ( I have been using Notepad++ for my PHP development). Why not learn a new language

Read More Sublime Text 3 Error – ‘python’ is not recognized as an internal or external command