
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
A reusable Django app for GDPR-compliant cookie consent management, featuring integration with Google Tag Manager (GTM) and Google Consent Mode V2. Originally developed for Lightning Fast Shop, it is designed for use in any Django project.
Note: LFS Cookie Consent currently supports only Google Analytics cookies. Additional cookie types will be supported in upcoming releases.
analytics_storage
)Add the app to your Django project:
lfs_cookie_consent
by running: pip install lfs-cookie-consent
.'lfs_cookie_consent'
to your INSTALLED_APPS
in settings.py
.Configure your GTM ID in settings.py
:
GTM_ID = "GTM-XXXXXXX" # Replace with your GTM container ID
Collect static files:
python manage.py collectstatic
Include the template tags and the provided CSS and JavaScript in your base template:
{% load static %}
{% load lfs_cookie_consent_tags %}
<head>
<link rel="stylesheet" href="{% static 'lfs_cookie_consent/lfs_cookie_consent.css' %}">
<script src="{% static 'lfs_cookie_consent/lfs_cookie_consent.js' %}"></script>
{% gtm_script %}
</head>
<body>
{% gtm_noscript %}
{% cookie_banner %}
{% cookie_modal %}
</body>
Add a link to open the modal anywhere:
<a href="#" onclick="window.showCookieSettings(); return false;">Open cookie settings</a>
analytics_storage
).Page View
trigger to your tagThis package includes a simple test view that lets you quickly try out the cookie banner and modal. The view renders a sample page with all relevant components.
How to use the test view:
Temporarily add the test view URL to your project:
Open your main urls.py
(e.g., in your main project or test project) and add:
from lfs_cookie_consent.views import test_cookie_banner
from django.urls import path
urlpatterns = [
# ... your other URLs ...
path("", test_cookie_banner, name="test_cookie_banner"),
]
Open your project's start page in the browser. You should see the cookie banner and modal as intended.
Open your browser's developer tools, go to the cookies section, and observe how cookies are set or deleted based on your consent choices.
Remove the temporary URL once you have finished testing the functionality.
MIT License
FAQs
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
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.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.