
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Async thumbnail
.. image:: https://badge.fury.io/py/async-thumbnail.png :target: https://badge.fury.io/py/async-thumbnail
Offload sorl thumbnail rendering to a render view.
.. code-block:: sh
pip install async-thumbnail
.. note:: Make sure you have sorl thumbnails <https://github.com/jazzband/sorl-thumbnail>
_ configured.
.. code-block:: python
# settings.py
INSTALLED_APPS = (
# ...
'async_thumbnail',
# ...
)
# urls.py
urlpatterns = [
# ...
path('', include('async_thumbnail.urls')),
# ...
]
.. code-block:: html
{% load async_thumbnail %}
<!-- Default -->
<img src="{% async_thumbnail object.image "900x600" crop="center" %}">
<!-- Save as var -->
{% async_thumbnail object.image "900x600" crop="center" as im %}
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}">
When you use the default full page caching middleware, it may be a good idea to replace it with this middleware. This prevents cache from being updated when the content contains a render URL.
.. warning:: In case you're using things like source sets <https://www.w3schools.com/tags/att_source_srcset.asp>
_
or lazy loading techniques this may be a bad idea.
.. code-block:: python
# settings.py
MIDDLEWARE = (
'django.middleware.cache.UpdateCacheMiddleware',
# ...
'async_thumbnail.middleware.FetchFromCacheMiddleware',
)
ASYNC_THUMBNAIL_ENDPOINT
''
Optional setting to determine an absolute path for rendering.
ASYNC_THUMBNAIL_PATTERN_NAME
'async_thumbnail:render'
Pattern name for render URL's.
FAQs
Offload sorl thumbnail rendering to a render view.
We found that async-thumbnail 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.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.