
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
django-template-minifying-loader
Advanced tools
Django application, providing simple template loader. It reduces HTML output in templates by stripping out whitespace characters between HTML and django template tags. This is an update of django-template-minifier <https://github.com/iRynek/django-template-minifier>
_ that works with django 1.10.
Things to note:
It does not make any fancy compression, to do that use GZip Middleware <https://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.gzip>
_.
To compress CSS and JS use django-compressor <https://github.com/jezdez/django_compressor>
_.
virtualenv <http://www.virtualenv.org/en/latest/#what-it-does>
_ - yup we highly recommend it!.. code-block:: bash
pip install django-template-minifying-loader
Modify Your Django project settings's module.
For production (note cached loader):
.. code-block:: python
TEMPLATES = [ { 'DIRS': [ str(APPS_DIR.path('templates')), ], 'OPTIONS': { 'loaders': [ 'django.template.loaders.cached.Loader', 'template_minifying_loader.loaders.filesystem.Loader', 'template_minifying_loader.loaders.app_directories.Loader', ], }, }, ]
For development (each refresh reloads template):
.. code-block:: python
TEMPLATES = [ { 'DIRS': [ str(APPS_DIR.path('templates')), ], 'OPTIONS': { 'loaders': [ 'template_minifying_loader.loaders.filesystem.Loader', 'template_minifying_loader.loaders.app_directories.Loader', ], }, }, ]
Be happy having less spaces and new lines in Your templates!
Using modified settings You can:
.. code-block:: python
TEMPLATE_MINIFIER_HTML_TAGS = False # default = True
.. code-block:: python
TEMPLATE_MINIFIER_TEMPLATE_TAGS = False # default = True
.. code-block:: python
TEMPLATE_MINIFIER = False # default = True
.. code-block:: python
TEMPLATE_MINIFER_STRIP_FUNCTION = 'template_minifier.utils.strip_spaces_in_template'
(There is a typo in variable name, see #2 for details)
.. code-block:: python
if DEBUG: TEMPLATE_MINIFIER = False
.. code-block:: js
// comment something - !!it's evil!! {% if %} function name(){ } {% endif %}
Use / / instead
.. code-block:: js
/* comment something - it's nice and clean <3! */ {% if %} function name(){ } {% endif %}
Or just set TEMPLATE_MINIFIER_TEMPLATE_TAGS = False
FAQs
Simple Django template loader that minifies html output.
We found that django-template-minifying-loader 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.