Comments (5)
There is some code to monkeypatch safety in by default, like Django does for its template system. Maybe it makes sense to move this from nuggets to jingo itself?
from jingo.
Yes, martin if you move that code into jingo, I'll review it. WE should give enough batteries in jingo to make jinja usable in Django.
from jingo.
Thanks for patch, it`s actually working. But I not sure how this monkey patch works with classic django apps - imagine project using django templates in one app and jinja2 in second. Philosophically I tend towards to extend jinja2 to accept django.utils.safestring functions.
from jingo.
Going to finally take a look at this. safe_django_forms
belongs in jingo.monkey
or something similar.
from jingo.
I probably should've attached the PR in #26 to this instead, but oh well. Closing this in favor of the new one.
@martinsvoboda: Several of our projects are in the exact situation you described: the Django admin uses Django templates even with jingo/jinja2 installed. Adding __html__()
to these form classes has no effect, because Django doesn't even know to look for it.
The only potential interference is from the change to conditional_escape
, but it turns out it doesn't change much, or at least not for us. To be a little less intrusive, in #26 I changed the code from nuggets so that it respects both Jinja2 and Django's definition of "already safe".
from jingo.
Related Issues (20)
- No `override` for register.filter
- Bug in ability to use render_to_string() HOT 1
- JINGO_EXCLUDE_APPS + Django admin HOT 2
- datetime helper breaks on Windows HOT 2
- Django test fails with Jingo installed HOT 2
- Doesn't populate test data correctly HOT 3
- Translations don't work HOT 8
- Circular Imports HOT 1
- helpers.f doesn't convert to string first as it used to HOT 5
- Review the need to monkey patch on modern Django HOT 2
- JINGO_EXCLUDE_APPS doesn't work with sitemap HOT 1
- Django 1.7 breakages HOT 3
- Please release a new version to PyPI HOT 6
- Django 1.7: AttributeError: 'module' object has no attribute 'StrAndUnicode' HOT 1
- Tag & release 0.8 HOT 11
- Jingo does not support django.contrib.admin.apps.SimpleAdminConfig
- Push 0.7 tag to GitHub HOT 1
- Add me to your committers or transfer the app over to Mozilla HOT 9
- Replace built-in helpers with Jinja extension
- Port to Django 1.9: ``from django.template.base import TemplateDoesNotExist`` ImportError. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jingo.