# Django tag jinja2

**URL:** <https://forum.pinegrow.com/t/django-tag-jinja2/487>\
**Category:** General\
**Tags:** bug, feature-request\
**Created:** [December 10, 2016, 12:14pm UTC](https://forum.pinegrow.com/t/django-tag-jinja2/487 "2016-12-10T12:14:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ados1991](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ados1991](https://forum.pinegrow.com/u/ados1991)\
**Post date:** [December 10, 2016, 12:14pm UTC](https://forum.pinegrow.com/t/django-tag-jinja2/487/1 "2016-12-10T12:14:17Z")

</div>

Hello,

I have an old and big project in django. and my html files are .htm.j2 (files jinja templates) and i would like open them in pinegrow but it not work with msg (page contains syntax errors due to jinja tags) i want to force this opening and works with css and tell to pinegrow to ignore vars tags of jinja2

Thanks

---

<div class="post-metadata">

**Author:** ![Rob](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/rob/32/9_2.png) [@Rob](https://forum.pinegrow.com/u/Rob)\
**Post date:** [December 10, 2016, 7:05pm UTC](https://forum.pinegrow.com/t/django-tag-jinja2/487/2 "2016-12-10T19:05:22Z")

</div>

Hi @ados1991 I don’t know if the information [here](http://docs.pinegrow.com/editing/editing-php-html-templates) would be of use to you but you should have a read, it just might help.

---

<div class="post-metadata">

**Author:** ![ados1991](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ados1991](https://forum.pinegrow.com/u/ados1991)\
**Post date:** [December 11, 2016, 11:31am UTC](https://forum.pinegrow.com/t/django-tag-jinja2/487/3 "2016-12-11T11:31:12Z")

</div>

he is not helpful because he only works for some tags defined(php, asp, eg…) if i can define custom tag for jinja2, its may hepful but for my personal opnion i think we need the new feature for this, but i will continue to search.

thanks

---

<div class="post-metadata">

**Author:** ![Terry44](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/terry44/32/175_2.png) [@Terry44](https://forum.pinegrow.com/u/Terry44)\
**Post date:** [December 12, 2016, 4:14am UTC](https://forum.pinegrow.com/t/django-tag-jinja2/487/4 "2016-12-12T04:14:30Z")

</div>

I have heavily embedded PHP in files that are basically template files that gets generated by PHP and populated with content. Pinegrow can’t do much with that and I only see php code. I don’t use Django but for my PHP laden files in the tree view I use the eye icons to turn off those lines in Pinegrow and this leaves the bare template and I then can work on styling and updating the html.

Alternatively you can remove all the Django code in your files by using something like Notepad++ and either go line by line or use regx find replace to remove the Django tags from your page. I like the Pinegrow way better though because I don’t have to remove the code and it just gets ignored. Takes some time to do if you have a lot of tags. All it does is adds a class to your containers or elements which you can remove with find replace and have it done all at once instead of manually turning each disabled element back on.

---

<div class="post-metadata">

**Author:** ![ados1991](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ados1991](https://forum.pinegrow.com/u/ados1991)\
**Post date:** [December 13, 2016, 10:05am UTC](https://forum.pinegrow.com/t/django-tag-jinja2/487/5 "2016-12-13T10:05:32Z")

</div>

your solution is good if it is small project but i have big project.

The better way is to create custom like this  
var pgScripts = {  
’\<?php' : { type: 'php', name: 'PHP', close: '?\>’ },  
’\<?=' : { type: 'php', name: 'PHP', close: '?\>’ },  
’\<?' : { type: 'php', name: 'PHP', close: '?\>’ },  
’{%’ : { type: ‘angular’, name: ‘ANGULAR’, close: ‘%}’ },  
’{$’ : { type: ‘django’, name: ‘Django’, close: ‘$}’ },  
’\<%’ : { type: ‘asp’, name: ‘ASP & ERB’, close: ‘%\>’ }  
}

in pg-parser.js but i need some documentation code to do this.

---

<div class="post-metadata">

**Author:** ![griffin2000](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@griffin2000](https://forum.pinegrow.com/u/griffin2000)\
**Post date:** [January 27, 2017, 10:22pm UTC](https://forum.pinegrow.com/t/django-tag-jinja2/487/6 "2017-01-27T22:22:11Z")

</div>

I also have this issue (I’m using Pinegrow to design my Flask frontend). Did you have any luck with this?

---

<div class="post-metadata">

**Author:** ![griffin2000](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@griffin2000](https://forum.pinegrow.com/u/griffin2000)\
**Post date:** [January 27, 2017, 11:11pm UTC](https://forum.pinegrow.com/t/django-tag-jinja2/487/7 "2017-01-27T23:11:09Z")

</div>

Where did you find pg-parser.js? That definitely seems like a good place to start, but can’t find it either in my project or in the PineGrow install folder.
