{ "info": { "author": "Clinton Blackburn", "author_email": "cblackburn@kyruus.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "django-legal\n============\n\nThis Django app adds support for versioned terms of service.\n\nInstallation\n------------\n1. Install with pip::\n\n $ pip install django-legal\n\n2. Add ``legal`` to your ``INSTALLED_APPS`` setting.\n3. *(Optional)* Add a new setting: ``LEGAL_TOS_NAME = 'terms_of_service'``\n4. Update ``urls.py`` with the following::\n\n url(r'^legal/', include('legal.urls')),\n\n5. Create a new Agreement and AgreementVersion (ideally via data migration)::\n\n # -*- coding: utf-8 -*-\n import os\n from south.v2 import DataMigration\n\n # This should be the same value as LEGAL_TOS_NAME (if you overrode it)\n AGREEMENT_NAME = 'tos'\n\n\n class Migration(DataMigration):\n def forwards(self, orm):\n agreement, created = orm['legal.Agreement'].objects.get_or_create(name=AGREEMENT_NAME)\n\n # This file should live in the same directory as the migration\n f = open('%s/tos_content_2013_08_01.html' % os.path.dirname(__file__), 'r')\n orm['legal.AgreementVersion'].objects.create(agreement=agreement, date='2013-08-01', content=f.read())\n\n def backwards(self, orm):\n agreement = orm['legal.Agreement'].objects.get(name=AGREEMENT_NAME)\n agreement.delete()\n\n models = {\n 'legal.agreement': {\n 'Meta': {'object_name': 'Agreement'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': (\n 'django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'})\n },\n 'legal.agreementversion': {\n 'Meta': {'ordering': \"['-date']\", 'unique_together': \"(('agreement', 'date'),)\",\n 'object_name': 'AgreementVersion'},\n 'agreement': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['legal.Agreement']\"}),\n 'content': ('django.db.models.fields.TextField', [], {}),\n 'date': ('django.db.models.fields.DateTimeField', [], {}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})\n }\n }\n\n # Change this to be the name of the app where the migration lives\n complete_apps = ['my-app']\n symmetrical = True\n\n\n\nTesting This App\n----------------\nA modified ``manage.py`` and Django settings file are included to test this app::\n\n $ python manage.py test\n\n\nTesting Your App\n----------------\nYou may find the middleware a bit excessive for your tests as it requires you to create an agreement and version, and accept the agreement on behalf of your tests users. If you want to disable the middleware, add the following to your settings::\n\n if 'test' in sys.argv:\n MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES)\n MIDDLEWARE_CLASSES.remove('legal.middleware.TermsOfServiceAcceptanceMiddleware')", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Kyruus/django-legal", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "django-legal", "package_url": "https://pypi.org/project/django-legal/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-legal/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Kyruus/django-legal" }, "release_url": "https://pypi.org/project/django-legal/1.0/", "requires_dist": null, "requires_python": null, "summary": "A Django app to require user acceptance of terms of service.", "version": "1.0" }, "last_serial": 1036715, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "88c0b73e3fcc783aa67dd8c6c9c718a8", "sha256": "ca3b7e11a482a31bfb06bd4d9eaf0a7174cc30bcd6cd3ed3a6a89806b0517647" }, "downloads": -1, "filename": "django-legal-0.1.tar.gz", "has_sig": false, "md5_digest": "88c0b73e3fcc783aa67dd8c6c9c718a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7999, "upload_time": "2014-03-18T15:00:15", "url": "https://files.pythonhosted.org/packages/57/e4/7e75aedbb113f1bebd5b819ec68538b6944c65322188cca993e14d8e8954/django-legal-0.1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "fa6b24c298a4926079d0aab6c0b66c5e", "sha256": "478cd870e4de0446f965fd63c14ac682235a1e3d0d1264c545dab050b8287d01" }, "downloads": -1, "filename": "django-legal-1.0.tar.gz", "has_sig": false, "md5_digest": "fa6b24c298a4926079d0aab6c0b66c5e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8413, "upload_time": "2014-03-21T05:10:53", "url": "https://files.pythonhosted.org/packages/9b/42/8173e9d42b5e06d6615a99b0e1d8e1ed37eb0ba128a951cb262754064ccf/django-legal-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fa6b24c298a4926079d0aab6c0b66c5e", "sha256": "478cd870e4de0446f965fd63c14ac682235a1e3d0d1264c545dab050b8287d01" }, "downloads": -1, "filename": "django-legal-1.0.tar.gz", "has_sig": false, "md5_digest": "fa6b24c298a4926079d0aab6c0b66c5e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8413, "upload_time": "2014-03-21T05:10:53", "url": "https://files.pythonhosted.org/packages/9b/42/8173e9d42b5e06d6615a99b0e1d8e1ed37eb0ba128a951cb262754064ccf/django-legal-1.0.tar.gz" } ] }