Software engineering facts, information, and skills shared by Varghese Chacko

How to deal with “SubfieldBase has been deprecated. Use Field.from_db_value...

Varghese Chacko 1 year, 1 month ago

How to deal with "SubfieldBase has been deprecated. Use Field.from_db_value instead." On upgrade to Django 1.9, we may now get the warning

Python: ImportError: cannot import name generic

Varghese Chacko 1 year, 1 month ago

After upgrading to django 1.9. Whenever I was executing the command ./manage.py runserver , I got the error :

Python 3: Unexpected Exception: name 'basestring' is not defined when invok...

Varghese Chacko 1 year, 1 month ago

Python 3: Unexpected Exception: name 'basestring' is not defined when invoking ansible2 

Python 3 - Django: ImportError: No module named 'django.core.urlresolvers'

Varghese Chacko 1 year, 1 month ago

Python 3 - Django 2.x: ImportError: No module named 'django.core.urlresolvers' is a common error we get when we migrate from python 2.x to python 3.x and use latest Django > 2.0. the common error message looks like 

Install specific git commit with pip

Varghese Chacko 1 year, 2 months ago

To install specific git commit with pip,  You can specify commit hash, branch name, tag.

What is @permalink and get_absolute_url in Django?

Varghese Chacko 1 year, 2 months ago

What is @permalink and get_absolute_url in Django? When and why to use it?

How to install Python package from GitHub?

Varghese Chacko 1 year, 2 months ago

How to install Python package from GitHub?

Get the previous months name

Varghese Chacko 1 year, 2 months ago

Often we need to get previous months name in python, especially, when we have to save report from previous month's name. In python its is pretty simple. 

Get month name from month number

Varghese Chacko 1 year, 2 months ago

How can we get the month name from the month number? For instance, if I have 3, I want to return march? Most simple method is to define a function that checks for the number and return name.