Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Django''s application for handling privacy and cookie policies configured with Iubenda.
Click here and get 10% discount on first year at Iubenda
pip install django-iubenda
settings.py
by adding the app to INSTALLED_APPS
:
INSTALLED_APPS = (
"modeltranslation",
# ...
"iubenda",
# ...
)
settings.py
by adding the app's context processor to TEMPLATES
:
TEMPLATES = [
{
# ...
"OPTIONS": {
"context_processors": [
# ...
"iubenda.context_processors.iubenda",
# ...
],
},
},
]
settings.py
:
MIDDLEWARE = (
# ...
"django.middleware.locale.LocaleMiddleware",
# ...
)
settings.py
:
MIDDLEWARE = (
# ...
"django.contrib.sites.middleware.CurrentSiteMiddleware",
# ...
)
url.py
by adding the app's urls to urlpatterns
:
urlpatterns += [
path("", include("iubenda.urls")),
]
url.py
by adding the app's sitemaps to sitemaps
:
from iubenda.sitemaps import PrivacySitemap, CookieSitemap
sitemaps = {
# ...
"privacy": PrivacySitemap,
"cookie": CookieSitemap,
# ...
}
LANGUAGE_CODE
is available for HTML templates:
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
footer.html
add following code:
{% if not debug %}
{% block iubenda %}{% include "iubenda/include-content.html" %}{% endblock iubenda %}
{% endif %}
If Iubenda autoblocking's configurations are implemented in your account,
the variable IUBENDA_AUTOBLOCKING
can be set to import the site's script.
<script src="https://cs.iubenda.com/autoblocking/{{ cx_iubenda.iub_site_id }}.js"></script>
If Content Security Policy are implemented in your server and inline scripts are disabled,
the variable IUBENDA_CSP_NONCE
can be set with nonce tag will be inserted script's nonce.
<script {% if cx_iubenda_nonce %}nonce="{{ cx_iubenda_nonce }}"{% endif %}>
Inside your webserver's configurations, a rule to dynamically replace your CONSTANT nonce in a random string is needed.
To allow external source from Iubenda domains, please implement these rules:
Content-Security-Policy:
script-src-elem https://*.iubenda.com";
img-src https://*.iubenda.com data:";
style-src https://*.iubenda.com";
connect-src https://*.iubenda.com";
frame-src https://*.iubenda.com";
If you prefer to not allow unsafe-inline inside your CSP, please also add the two specific hash for your script prompted as error in Javascript Console.
# Iubenda Privacy And Cookie Policy - API
Content-Security-Policy:
...
script-src-elem https://*.iubenda.com 'sha256-YOUR-FIRST-HASH-PROMPTED-INSIDE-CONSOLE' 'sha256-YOUR-SECOND-HASH-PROMPTED-INSIDE-CONSOLE';
...
Check this article from Iubenda help
To personalize the Iubenda script's behaviour, the dict IUBENDA_OPTIONS
can be configured inside settings.py
IUBENDA_OPTIONS = {
"countryDetection": "true",
"askConsentAtCookiePolicyUpdate": "true",
"enableFadp": "true",
"enableLgpd": "true",
"lgpdAppliesGlobally": "true",
"enableUspr": "true",
"enableCcpa": "true",
"ccpaAcknowledgeOnDisplay": "true",
"ccpaApplies": "true",
"consentOnContinuedBrowsing": "false",
"floatingPreferencesButtonDisplay": "bottom-left",
"invalidateConsentWithoutLog": "true",
"perPurposeConsent": "true",
"whitelabel": "false",
"banner": {
"acceptButtonDisplay": "true",
"backgroundOverlay": "true",
"closeButtonRejects": "true",
"customizeButtonDisplay": "true",
"explicitWithdrawal": "true",
"fontSize": "14px",
"listPurposes": "true",
"position": "float-center",
"rejectButtonDisplay": "true",
"showPurposesToggles": "true",
},
}
If Google Tag Manager is implemented in your application and all needed settings were configured inside the container,
the variable IUBENDA_GTM
can be set with the value True
and the Iubenda's callback will be inserted inside the script.
For needed configuration inside Google Tag Manager container, please refer to these notes:
git clone --depth=50 --branch=django-iubenda https://github.com/DLRSP/example.git DLRSP/example
cd DLRSP/example
python manage.py runserver
Now browser the app @ http://127.0.0.1:8000
FAQs
Django''s application for handling privacy and cookie policies configured with Iubenda.
We found that django-iubenda 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.