Code Monkey home page Code Monkey logo

Comments (5)

jsocol avatar jsocol commented on June 20, 2024

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.

davedash avatar davedash commented on June 20, 2024

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.

martinsvoboda avatar martinsvoboda commented on June 20, 2024

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.

jsocol avatar jsocol commented on June 20, 2024

Going to finally take a look at this. safe_django_forms belongs in jingo.monkey or something similar.

from jingo.

jsocol avatar jsocol commented on June 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.