
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Easier layouts for Jinja templates.
pip install jinja-layout
The jinja_layout.LayoutExtension
needs to be added to your environment:
from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader(__name__, 'templates'))
env.add_extension('jinja_layout.LayoutExtension')
Jinja-layout introduces the use_layout
directive. There are two
optional arguments:
You can change the default layout template using the defaut_layout
attribute on your environment and the default block name using
the default_layout_block
attribute.
This directive is similar to Jinja's extends
directive but does
not require the use of blocks. The content which is not used in
blocks, will be automatically wrapped in a block. The name of this
block is defined by the second argument of the directive.
Let's consider the following layout saved as layout.html:
<html>
<head>{% block head %}{% endblock %}</head>
<body>{% block content %}{% endblock %}</body>
</html>
Basic layout example:
{% use_layout %}
hello world
Overriding the header block:
{% use_layout %}
{% block head %}<title>example</title>{% endblock %}
hello world
Using blocks all the way:
{% use_layout %}
{% block head %}<title>example</title>{% endblock %}
{% block content %}hello world{% endblock %}
FAQs
Extended layout system for Jinja
We found that jinja-layout demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.