To use this - add add_attr.py to you your Django project in the templatetags directory.
Structure would look something like this:
- Project Dir
- App Dir
- templatetags
- add_attr.py
 
 
- templatetags
 
- App Dir
In the view where you want to add an attribute to something - you would load it at the top of the file with