Custom Tags in Django 1.2 with Google App Engine Python 2.7
Question: Creating a custom tag in Google App Engine Python2.5 with Webapp used to be a
joyful experience. Here: [Django Templates and variable
attributes](http://stackoverflow.com/questions/35948/django-templates-and-
variable-attributes)

But now, in Python 2.7 with Webapp2 and Django 1.2, it is a pain in the ass. I
can only find bits of information here and there, and some of the methods
contradict with each other.

The method described in <http://www.john-smith.me/Tag/webapp2> ranks high in
Google, but some people claim it is "what a waste of time" [Webapp2 custom
tags](http://stackoverflow.com/questions/10618551/webapp2-custom-tags)

This one method seems to work

    
    
    from django.template.loader import add_to_builtins
    add_to_builtins('xxxxx')
    

But I dont know the details. Who can provide a step by step example?

I dont know why there are no official documents about these stuff. I mean,
this is not science experiments in which we explore the unknown. There
supposed to be some documentation so the developers can save their time.


Answer: I had same problem.

The fix:

  1. Create templatetags folder. Add there module with custom tags as explained in Django docs [Custom template tags and filters](https://docs.djangoproject.com/en/1.4/howto/custom-template-tags/). Example folder structure:
    
        app.yaml  
        myapp/
            __init__.py
            templatetags/
               __init__.py
               myTags.py
    

  2. In settings.py set INSTALLED_APPS to myapp (name of folder which contains templatetags sub-folder): 
    
        INSTALLED_APPS = ( 'myapp' )
    

  3. Now when you call {% load myTags %} in template Django should also seek the mytags module in myapp/*/templatetags/ folder.

