Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Jinja2 and MarkupSafe #359

Merged
merged 1 commit into from Apr 4, 2019
Merged

Conversation

msabramo
Copy link
Contributor

@msabramo msabramo commented Mar 22, 2019

_ = languagePluginLoader.then(() => {
  // pyodide is now ready to use...
  pyodide.loadPackage('Jinja2').then(() => {
    pyodide.runPython(`
import jinja2

template = jinja2.Template('Hello {{ name }}!')
print(template.render(name='Zach'))
    `);
  });
});

@msabramo msabramo force-pushed the Jinja2-and-MarkupSafe branch 2 times, most recently from a3f21ce to 23e1e81 Compare March 22, 2019 17:25
@msabramo
Copy link
Contributor Author

@madhur-tandon: Does this work for you?

Copy link
Collaborator

@mdboom mdboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MarkupSafe import test seems to be failing.

@msabramo msabramo force-pushed the Jinja2-and-MarkupSafe branch 2 times, most recently from 6915f5b to 102d534 Compare March 26, 2019 17:47
@msabramo
Copy link
Contributor Author

The import of markupsafe needs to be lowercase. I just amended and force-pushed with that change. 🤞

@msabramo
Copy link
Contributor Author

Screen Shot 2019-03-26 at 11 48 55 AM

test/test_jinja2.py Outdated Show resolved Hide resolved
```javascript
_ = languagePluginLoader.then(() => {
  // pyodide is now ready to use...
  pyodide.loadPackage('Jinja2').then(() => {
    pyodide.runPython(`
import jinja2

template = jinja2.Template('Hello {{ name }}!')
print(template.render(name='Zach'))
    `);
  });
});
```
@mdboom mdboom merged commit 875df76 into pyodide:master Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants