{ "info": { "author": "George Tantiras", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3 :: Only", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Internet :: WWW/HTTP :: Site Management" ], "description": "[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/raratiru/django-letsagree.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/raratiru/django-letsagree/context:python)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/61b3e157f170421ca3388f83567a873a)](https://www.codacy.com/app/raratiru/django-letsagree?utm_source=github.com&utm_medium=referral&utm_content=raratiru/django-letsagree&utm_campaign=Badge_Grade)\n[![Build Status](https://travis-ci.com/raratiru/django-letsagree.svg?branch=master)](https://travis-ci.com/raratiru/django-letsagree)\n[![Coverage Status](https://coveralls.io/repos/github/raratiru/django-letsagree/badge.svg?branch=travis)](https://coveralls.io/github/raratiru/django-letsagree?branch=travis)\n[![Updates](https://pyup.io/repos/github/raratiru/django-letsagree/shield.svg)](https://pyup.io/repos/github/raratiru/django-letsagree/)\n[![Known Vulnerabilities](https://snyk.io/test/github/raratiru/django-letsagree/badge.svg?targetFile=test_setup%2Frequirements.txt)](https://snyk.io/test/github/raratiru/django-letsagree?targetFile=test_setup%2Frequirements.txt)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\n[![Python Versions](https://img.shields.io/badge/Python-3.5%20|%203.6%20|%203.7%20|%203.8-%236600cc)](https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django)\n[![Django Versions](https://img.shields.io/badge/Django-2.1%20|%202.2-brown.svg)](https://www.djangoproject.com/download/)\n[![Database Window Functions](https://img.shields.io/badge/Database-Window%20Functions-important.svg)](https://www.sql-workbench.eu/dbms_comparison.html)\n\nLet's Agree\n======\n\nFeatures\n--------\n\n* Terms [versioning](#version) in \"[`deque`](https://docs.python.org/3.7/library/collections.html#collections.deque)-style\" with `maxlen=1`.\n* Per-Group Term association, per-User Term acceptance for each Group a user belongs to.\n* [Max 1 query](#queries), either per request or per day for each logged-in user.\n* [Multi-language](#translation) ready.\n* [Freedom](#permissions) for each user to withdraw consent at any time.\n\n\nAbout\n---\n\n`django-letsagree`is the result of an effort to follow the spirit of [The EU General Data Protection Regulation (GDPR)](https://eugdpr.org/).\n\nA logged in user can belong to one or more Groups.\n\nIf one or more Groups are associated with `django-letsagree`, all users that login as members of those Groups will be asked to provide their consent to the Terms related with each Group. This action, will be recorded in the database.\n\nThe Terms associated with a Group, can be updated with newer versions.\n\nSuch a decision will trigger again the mechanism which asks for the consent of each user before allowing any other operation on the site.\n\nIf the user does not provide consent, the following actions are only allowed:\n\n* Logout.\n* View and delete all instances of own consent provided.\n* View all Terms\n\n\nPrerequisites\n-------\n\n* Python 3.5, 3.6, 3.7, 3.8\n* Django 2.1, 2.2\n* [Django Admin Site](https://docs.djangoproject.com/en/dev/ref/contrib/admin/) (enabled by default in Django)\n* [Django Sessions](https://docs.djangoproject.com/en/dev/topics/http/sessions/#enabling-sessions) (enabled by default in Django)\n* A database with [Window Functions support](https://www.sql-workbench.eu/dbms_comparison.html)\n* [`django-translated-fields`](https://github.com/matthiask/django-translated-fields)\n\nInstallation\n-------\n1. `pip install django-letsagree`\n\n2. project/settings.py\n ```python\n INSTALLED_APPS = [\n ...\n 'letsagree.apps.LetsagreeConfig',\n ...\n ]\n\n MIDDLEWARE = [\n ...\n 'letsagree.middleware.LetsAgreeMiddleware', # Near the end of the list\n ...\n ]\n ```\n\n3. `` is the name of the project that hosts django-letsagree\n\n project/settings.py:\n ```python\n MIGRATION_MODULES = {\n 'letsagree': '.3p_migrations.letsagree',\n }\n ```\n\n4. Make sure [LANGUAGES](https://docs.djangoproject.com/en/dev/ref/settings/#languages) are properly set as explained in the [Translation](#translation) section.\n The default implementation will create as **many fields** as the number of `LANGUAGES` Django has set by default.\n\n\n5. project/urls.py:\n\n ```python\n urlpatterns = [\n ...\n path('path/to/letsagree/', include('letsagree.urls')),\n ...\n ]\n ```\n\n6. Create the migrations:\n\n ```python\n ./manage.py makemigrations letsagree\n ./manage.py migrate\n ```\n\n\n7. [Sessions](https://docs.djangoproject.com/en/dev/topics/http/sessions/#enabling-sessions) should be enabled.\n\n### Notes on installation\n\n* `django-letsagree` itself does not come with any migrations. It is recommended\n that you add migrations for its models in your project and avoid using the\n word `migrations` as the name of the folder.\n\n The relevant Django setting is [`MIGRATION_MODULES`](https://docs.djangoproject.com/en/dev/ref/settings/#migration-modules).\n In the following example, we will create a folder called `3p_migrations`\n in the main project folder where `settings.py` lies.\n\n If you wish to use a new folder, do not forget to create an empty `__init__.py` inside it.\n\n\nSettings\n--------\n\n### Default Settings\n```python\nLETSAGREE_CACHE = False\nLETSAGREE_CSS = {}\nLETSAGREE_JS = ()\nLETSAGREE_LOGOUT_APP_NAME = 'admin'\nLETSAGREE_BROWSER_TITLE = ''\nLETSAGREE_BORDER_HEADER = ''\n```\n\n### Database queries\n\n\nThe middleware generates one database query per request in order to make sure that the user has agreed to all the terms related with the Group(s) he belongs to.\n\nIf `LETSAGREE_CACHE = True`, [Django's Cache Framework](https://docs.djangoproject.com/en/dev/topics/cache/) will be used and only one database query will be generated by the middleware, every 24 hours.\n\n`LETSAGREE_CACHE` is not enabled by default, because it exposes the unique `id` for each user by creating a cache record with key `'letsagree-'`.\n\nTip: [django-hashid-field](https://github.com/nshafer/django-hashid-field), is a library that obscures unique `id`s, without compromising their uniqueness.\n\n\n### Translation\n\n\n**Watch your `LANGUAGES`**!\n\n#### Database\n\nBy default `lestagree` installs [`django-translated-fields`](https://github.com/matthiask/django-translated-fields) to cater for translating the `title`, `summary` and `content` fields of the `Term` model. This library will create separate fields for each entry in the [`LANGUAGES`](https://docs.djangoproject.com/en/dev/ref/settings/#languages) list.\n\nThe first entry of this list is considered as the \"default language\". The relevant database field is marked as `blank=False` and it serves as a fallback value. This value is returned if an entry for the requested language does not exist.\n\nAll other fields that are related with the rest of the languages in the `LANGUAGES` list are marked as `blank=True` and can stay empty.\n\nAlthough the [`LANGUAGE_CODE`](https://docs.djangoproject.com/en/dev/ref/settings/#language-code) setting is not directly related with `letsagree` or `django-translated-fields` it is **strongly** recommended to match the first language in the `LANGUAGES` setting.\n\nExample:\n```python\nLANGUAGES = (('fr', 'French'), ('en', 'English'))\nLANGUAGE_CODE = 'fr'\n```\nThe model `Term` will include the following fields:\n```python\n{\n 'title_fr': {'blank': False},\n 'title_en': {'blank': True},\n 'summary_fr': {'blank': False},\n 'summary_en': {'blank': True},\n 'content_fr': {'blank': False},\n 'content_en': {'blank': True},\n}\n```\n\n#### Strings\n\nAll strings in `django-letsagree` are marked with one of the following ways which allow translation:\n* `django.utils.translation.gettext_lazy('')`\n* `{% trans \"\" %}`\n\n### Custom Form Assets\n\n`django-letsagree` uses`letsagree/pending.html` template which extends `admin/index.html`. Through a `FormView` this template receives a `Formset` which includes all the `Terms` that should receive consent from the user.\n\n`LETSAGREE_CSS` and `LETSAGREE_JS` when set, pass the relevant assets in the `Media` class of the `Form` that serves as the basis of the above mentioned Formset. The syntax is described in the relevant [django documentation.](https://docs.djangoproject.com/en/dev/topics/forms/media/#assets-as-a-static-definition)\n\nA good starting point could be the default css file provided by `django-letsagree`:\n\nsettings.py:\n```python\nLETSAGREE_CSS = {'all': ('letsagree/letsagree.css',)}\n```\n\nOf course, one can completely [override the templates](https://docs.djangoproject.com/en/dev/howto/overriding-templates/).\n\nIn that case, bear in mind that if `{{ empty_form }}` is False, `{{ form }}` contains a formset.\n\n\n### Other settings\n\n* `LETSAGREE_LOGOUT_APP_NAME`: A logout link will appear on the top right corner of both templates.\n\n This is formed as `reverse(:logout)`.\n\n The logout link defaults to `reverse('admin:logout')`.\n\n* `LETSAGREE_BROWSER_TITLE`: A title for the default template.\n* `LETSAGREE_BORDER_HEADER`: Text that will appear on the top left corner of the default template.\n\n\nPermissions\n-----------\n\nIt is your responsibility to assign every new user to a Group associated with `django-letsagree`. This group should at least include the `delete_notarypublic` permission in case a user whishes to revoke his consent.\n\nIf all permissions for `django-letsagree` models are delegated to a group, the below table illustrates what actions are allowed for user, with either `is_staff == True` or `is_superuser == True`:\n\n\n| Actions | superuser own entries | superuser other entries | admin-user own entries | admin-user other entries |\n| :-----| :------------------:| :--------------------: | :-------------------: | :---------------------: |\n| view_term | **True** | **True** | **True** |**True**|\n| add_term | **True** | | **True** | |\n| change_term | False | False | False | False |\n| delete_term | False | False | False | False |\n| view_notarypublic | **True** | **True** |**True** | False |\n| add_notarypublic | False | | False | |\n| change_notarypublic | False | False | False | False |\n| delete_notarypublic | **True** | False | **True** | False |\n\n### Term changelist contents\n\nUsers who have permission to add a new term, are allowed to read all the available terms. Otherwise, each user can only read the terms related to the group that he or she belongs to.\n\n\nNew Term Version\n----------------\nIf two instances of Term associate with the same Group, the instance saved-last is the latest version. All logged in users have to provide consent for this latest version, independently of any previous consent they may have or have not given for the Terms associated with this Group.\n\n`django-letsagree` takes into account if a logged-in user has provided consent only for the latest version of each Term associated with the Groups he belongs to. If not, the user can only logout or visit `django-letsagree` admin page retaining the right to delete any instances of consent he has provided.\n\nTests\n-----\n\nTo run the test suite, you need:\n\n* Virtualenv with tox installed.\n* PostgreSQL, MariaDB/MySQL databases with the same user, password, database name.\n* The following environment variables set: `TOX_DB_NAME`, `TOX_DB_USER`, `TOX_DB_PASSWD`.\n\nUnfortunatelly, the test suite is rather complicated. Sorry!\n\n### Coverage: Not tested\n\n* [`LETSAGREE_CSS`](https://github.com/raratiru/django-letsagree/blob/9436ddabb4467477ecb39d94fd09b6f574e9384f/letsagree/forms.py#L42-L44)\n* [`LETSAGREE_JS`](https://github.com/raratiru/django-letsagree/blob/9436ddabb4467477ecb39d94fd09b6f574e9384f/letsagree/forms.py#L42-L44)\n* [`letsagree.admin.term_parents`](https://github.com/raratiru/django-letsagree/blob/9436ddabb4467477ecb39d94fd09b6f574e9384f/letsagree/admin.py#L23-L27)\n\nChangelog\n---------\n1.0.3: Only users with add_perm can see all the Terms in changelist\n\n1.0.2: Addressed codacy reports, updated readme, installed pyup, snyk\n\n1.0.1: Added Travis, Coverage, LGTM, PyUp CI\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/raratiru/django-letsagree", "keywords": "", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "django-letsagree", "package_url": "https://pypi.org/project/django-letsagree/", "platform": "", "project_url": "https://pypi.org/project/django-letsagree/", "project_urls": { "Homepage": "https://github.com/raratiru/django-letsagree" }, "release_url": "https://pypi.org/project/django-letsagree/1.0.3/", "requires_dist": [ "Django (>=2.1)", "django-translated-fields" ], "requires_python": ">=3.5", "summary": "A django application that associates Groups with Terms requiring consent from logged in members.", "version": "1.0.3" }, "last_serial": 6003387, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "dd58a416efc8538903fa14d1dc585a95", "sha256": "e46f84f440fd7cdf14d838facc3ce8b85a0bbdb185f5a59969454f0f52dca9dc" }, "downloads": -1, "filename": "django_letsagree-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dd58a416efc8538903fa14d1dc585a95", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 17843, "upload_time": "2019-04-10T22:59:28", "url": "https://files.pythonhosted.org/packages/8d/59/484d529e444dbc79b6af896465e73dbd76d7667baf61ad806360e0351395/django_letsagree-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f6be751c10a3f84c86a2e05961f1f6e", "sha256": "6734f01a281a7051c490661a2002b630f12e8953b256a3bc2b0f63feb2a0788a" }, "downloads": -1, "filename": "django-letsagree-1.0.0.tar.gz", "has_sig": false, "md5_digest": "0f6be751c10a3f84c86a2e05961f1f6e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 13134, "upload_time": "2019-04-10T22:59:31", "url": "https://files.pythonhosted.org/packages/ad/b2/b76076ac67c6b529be984909b520b8c5541cd50bb27b59ea031643097fc4/django-letsagree-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "043a447b47b66ea14fd93c7b9ada2f81", "sha256": "6d272d63c98429eb4d78ac29969fc142f67f55439846939d6de1c7879fe88599" }, "downloads": -1, "filename": "django_letsagree-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "043a447b47b66ea14fd93c7b9ada2f81", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 18715, "upload_time": "2019-04-15T21:47:38", "url": "https://files.pythonhosted.org/packages/5a/7f/61b11998f3e77a6f27e1a3db7d4fbe9c5b1d227dbfaa3146c7a49ff32adf/django_letsagree-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6dc49b8697845fc8cefc12a8a3b04d1d", "sha256": "b7e7ed0bfe4ef958745f81799d53af292760f0a7beb4f67907ecb7ada3dce948" }, "downloads": -1, "filename": "django-letsagree-1.0.1.tar.gz", "has_sig": false, "md5_digest": "6dc49b8697845fc8cefc12a8a3b04d1d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 13931, "upload_time": "2019-04-15T21:47:41", "url": "https://files.pythonhosted.org/packages/fe/41/d17dd656b6efb6330b6deb3b4d415f1c8783fd09fdb30536e7e06e668875/django-letsagree-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "a0f07b7fa435c6354a947cd7dd40383a", "sha256": "356a82cd782151d643723f0143b440055c5969ab1fd645a305abf4c3b1644f1a" }, "downloads": -1, "filename": "django_letsagree-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a0f07b7fa435c6354a947cd7dd40383a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 19990, "upload_time": "2019-05-11T12:18:03", "url": "https://files.pythonhosted.org/packages/13/fb/02f88f7dd79f8721e57c4fa84caa85d1b2658b30c41bd4721528a0fc8247/django_letsagree-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "01648ac97f948f7e03edcf23942e9141", "sha256": "6283a24a31377473861cbc8bb59bdd249c8b87151bb29bd6a09c8f95769d57ca" }, "downloads": -1, "filename": "django-letsagree-1.0.2.tar.gz", "has_sig": false, "md5_digest": "01648ac97f948f7e03edcf23942e9141", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 14239, "upload_time": "2019-05-11T12:18:05", "url": "https://files.pythonhosted.org/packages/fd/29/056294aab28da73bd7d542a15adeb44e21463873dad6469478563c36d455/django-letsagree-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "4fac2fcb6b59e468d83b40ece67ceb33", "sha256": "46032f4cb4b000daf5339647343aa1f16aab29cb081c8eff611470c49397adc2" }, "downloads": -1, "filename": "django_letsagree-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "4fac2fcb6b59e468d83b40ece67ceb33", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 19241, "upload_time": "2019-10-20T16:23:00", "url": "https://files.pythonhosted.org/packages/f1/dc/5abad82d9add2c3c6c44a83536a70e81b134818d15b4306ff3e5e8a9bb9f/django_letsagree-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2bd0ca277481885db6bbfba6c1467b97", "sha256": "754b55b803bd7f398a249fdb7b0707d21b511896e49920595b9f7bc058a91188" }, "downloads": -1, "filename": "django-letsagree-1.0.3.tar.gz", "has_sig": false, "md5_digest": "2bd0ca277481885db6bbfba6c1467b97", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 16491, "upload_time": "2019-10-20T16:23:02", "url": "https://files.pythonhosted.org/packages/bc/f4/d1075e53edc2e138ff69faa8f50e38e84efaad25beecf868519a351c7221/django-letsagree-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4fac2fcb6b59e468d83b40ece67ceb33", "sha256": "46032f4cb4b000daf5339647343aa1f16aab29cb081c8eff611470c49397adc2" }, "downloads": -1, "filename": "django_letsagree-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "4fac2fcb6b59e468d83b40ece67ceb33", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 19241, "upload_time": "2019-10-20T16:23:00", "url": "https://files.pythonhosted.org/packages/f1/dc/5abad82d9add2c3c6c44a83536a70e81b134818d15b4306ff3e5e8a9bb9f/django_letsagree-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2bd0ca277481885db6bbfba6c1467b97", "sha256": "754b55b803bd7f398a249fdb7b0707d21b511896e49920595b9f7bc058a91188" }, "downloads": -1, "filename": "django-letsagree-1.0.3.tar.gz", "has_sig": false, "md5_digest": "2bd0ca277481885db6bbfba6c1467b97", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 16491, "upload_time": "2019-10-20T16:23:02", "url": "https://files.pythonhosted.org/packages/bc/f4/d1075e53edc2e138ff69faa8f50e38e84efaad25beecf868519a351c7221/django-letsagree-1.0.3.tar.gz" } ] }