Summary 1. Create “templatetags” folder at the same level as models.py, views.py. 2. Create “__init__.py” file in “templatetags” folder. The content will be empty. 3. Create “set_var.py” file in “templatetags” folder. And copy and paste below code from django import template register = template.Library() class SetVarNode(template.Node): def __init__(self, var_name, var_value): self.var_name = var_name self.var_value =…
Category: Django
EnvironmentError: mysql_config not found
I am using Mac OS X 10.9, MAMP 1.9 (MySQL 5.1.44), Python 2.7.5. Got this error when I change database configuration in settings.py. I felt this issue can make me painful, so I start logging what happened and how I fixed. Do not follow below steps. Just go straightly bottom of article and read last…