0

Given that i already have a large angularjs based code with template tag as {{ - is it possible to change django's template tag to maybe {[{ .. ?

haki
  • 9,389
  • 15
  • 62
  • 110
  • 1
    possible duplicate of [AngularJS with Django - Conflicting template tags](http://stackoverflow.com/questions/8302928/angularjs-with-django-conflicting-template-tags) – falsetru May 24 '14 at 06:35
  • The answers provide only a way of changing angular's template tag. I already have written a lot of code so i'm looking into changing django's tag. – haki May 24 '14 at 06:40
  • This will have to be the last resort. – haki May 24 '14 at 06:43

1 Answers1

0

Update

Perhaps dynamically patch it

import re
import django.template.base
django.template.base.VARIABLE_TAG_END = '}]}'
django.template.base.VARIABLE_TAG_START = '{[{'
django.template.base.tag_re = re.compile(ur'(\{\%.*?\%\}|\{\[\{.*?\}\]\}|\{\#.*?\#\})')
reload(django.template)

Put this in __init__.py of your any apps and see if it works.


No simple way currently, they are hardcoded:

VARIABLE_TAG_START = '{{'
VARIABLE_TAG_END = '}}'

Anyway, you could patch your local installation or forked version.

okm
  • 23,575
  • 5
  • 83
  • 90