Name | dc-consent JSON |
Version |
4.1.6
JSON |
| download |
home_page | None |
Summary | A Django app to add a cookie consent modal to your site. |
upload_time | 2024-09-19 11:01:26 |
maintainer | None |
docs_url | None |
author | Nigel |
requires_python | >=3.8 |
license | GPL-3.0-only |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Cookie Consent
==============
A Django app to add a cookie consent modal to your site.
This can then be used to check if the user has given consent to use cookies.
To clear the cookie preferences; the user can simple navigate to:
reverse('cookie_consent:revoke')
In templates; it is also possible to check if the user has given consent like so:
request.cookie_consent.allows('analytics') -> bool
Quick start
-----------
1. Add 'cookie_consent' to your INSTALLED_APPS setting like this:
```
INSTALLED_APPS = [
...,
'cookie_consent',
]
```
2. Include the cookie_consent URLconf in your project urls.py like this:
```
path('cookies/', include('cookie_consent.urls')),
```
3. Add the cookie_consent middleware to your MIDDLEWARE setting like this:
```
MIDDLEWARE = [
...,
'cookie_consent.middleware.CookieConsentMiddleware',
]
```
4. Use the 'cookie_consent' template tag in your base template like this:
```
{% load cookies_tags %}
{% cookie_consent %}
```
5. Check if the user has given consent to use cookies in your templates like this:
```
{% consents_to 'analytics' %}
<script>
// Will only get rendered if the user has given consent to use analytics cookies.
</script>
{% endconsents_to %}
```
6. We require you to use two asset files. These are located in:
```
static/cookie_consent/cookie-consent.css
static/cookie_consent/cookie-consent.js
```
Raw data
{
"_id": null,
"home_page": null,
"name": "dc-consent",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Nigel",
"author_email": "nigel@goodadvice.it",
"download_url": "https://files.pythonhosted.org/packages/9f/fa/f3f87c2e180be360cd88c572c6a6bd00fd7dde4128da0fa78921be2d21b1/dc_consent-4.1.6.tar.gz",
"platform": null,
"description": "Cookie Consent\r\n==============\r\n\r\nA Django app to add a cookie consent modal to your site.\r\nThis can then be used to check if the user has given consent to use cookies.\r\n\r\nTo clear the cookie preferences; the user can simple navigate to:\r\n\r\n reverse('cookie_consent:revoke')\r\n\r\nIn templates; it is also possible to check if the user has given consent like so:\r\n\r\n request.cookie_consent.allows('analytics') -> bool\r\n\r\nQuick start\r\n-----------\r\n\r\n1. Add 'cookie_consent' to your INSTALLED_APPS setting like this:\r\n\r\n ```\r\n INSTALLED_APPS = [\r\n ...,\r\n 'cookie_consent',\r\n ]\r\n ```\r\n2. Include the cookie_consent URLconf in your project urls.py like this:\r\n\r\n ```\r\n path('cookies/', include('cookie_consent.urls')),\r\n ```\r\n3. Add the cookie_consent middleware to your MIDDLEWARE setting like this:\r\n\r\n ```\r\n MIDDLEWARE = [\r\n ...,\r\n 'cookie_consent.middleware.CookieConsentMiddleware',\r\n ]\r\n ```\r\n4. Use the 'cookie_consent' template tag in your base template like this:\r\n\r\n ```\r\n {% load cookies_tags %}\r\n {% cookie_consent %}\r\n ```\r\n5. Check if the user has given consent to use cookies in your templates like this:\r\n\r\n ```\r\n {% consents_to 'analytics' %}\r\n \t<script>\r\n \t\t// Will only get rendered if the user has given consent to use analytics cookies.\r\n \t</script>\r\n {% endconsents_to %}\r\n\r\n ```\r\n6. We require you to use two asset files. These are located in:\r\n\r\n ```\r\n static/cookie_consent/cookie-consent.css\r\n static/cookie_consent/cookie-consent.js\r\n ```\r\n",
"bugtrack_url": null,
"license": "GPL-3.0-only",
"summary": "A Django app to add a cookie consent modal to your site.",
"version": "4.1.6",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9ffaf3f87c2e180be360cd88c572c6a6bd00fd7dde4128da0fa78921be2d21b1",
"md5": "c62f49896444ff8747ca595c83396d1e",
"sha256": "534e273363f821c415edf901db6d2cdd74bf0b048118fe4e65ddd18543dd96e2"
},
"downloads": -1,
"filename": "dc_consent-4.1.6.tar.gz",
"has_sig": false,
"md5_digest": "c62f49896444ff8747ca595c83396d1e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 31285,
"upload_time": "2024-09-19T11:01:26",
"upload_time_iso_8601": "2024-09-19T11:01:26.404122Z",
"url": "https://files.pythonhosted.org/packages/9f/fa/f3f87c2e180be360cd88c572c6a6bd00fd7dde4128da0fa78921be2d21b1/dc_consent-4.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-19 11:01:26",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "dc-consent"
}