{ "info": { "author": "Bruno Bastos", "author_email": "zerobruno@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.8", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries", "Topic :: System :: Logging" ], "description": "django-auditor\r\n==============\r\n\r\nThis Django app logs changes to models objects in a simple and\r\ngranular way. This app supports multi-tenant environments\r\nwhich use django-tenant-schemas.\r\n\r\nRequirements\r\n------------\r\n\r\nPython 3.4\r\n\r\nDjango 1.8\r\n\r\nInstallation (for environments without django-tenant-schemas)\r\n-------------------------------------------------------------\r\n\r\nAdd \"auditor\" to your INSTALLED_APPS setting like this:\r\n\r\n.. code-block:: python\r\n\r\n INSTALLED_APPS = (\r\n ...\r\n 'django_auditor',\r\n )\r\n\r\nAdd an empty dict 'AUDITOR' on your settings:\r\n\r\n.. code-block:: python\r\n\r\n AUDITOR = {}\r\n\r\nInclude the auditor URLconf in your project urls.py like this:\r\n\r\n.. code-block:: python\r\n\r\n url(r'^auditor/', include('django_auditor.urls'))\r\n\r\nRun `python manage.py makemigrations` to create the migration\r\nfile for auditor model.\r\n\r\nRun `python manage.py migrate` to apply the migration and\r\ncreate the Auditor model.\r\n\r\n\r\nInstallation (django-tenant-schemas environments)\r\n-------------------------------------------------\r\n\r\nAdd \"auditor\" to your SHARED_APPS or TENANT_APPS setting\r\nlike this:\r\n\r\n.. code-block:: python\r\n\r\n SHARED_APPS = (\r\n ...\r\n 'django_auditor',\r\n )\r\n\r\nor\r\n\r\n.. code-block:: python\r\n\r\n TENANT_APPS = (\r\n ...\r\n 'django_auditor',\r\n )\r\n\r\nAdd a dict 'AUDITOR' on your settings, specify a 'tenant'\r\nkey with the value of your tenant model:\r\n\r\n.. code-block:: python\r\n\r\n AUDITOR = {'tenant':'customers.Client'}\r\n\r\nInclude the auditor URLconf in your project urls.py like this:\r\n\r\n.. code-block:: python\r\n\r\n url(r'^auditor/', include('django_auditor.urls'))\r\n\r\nRun `python manage.py makemigrations` to create the migration\r\nfile for auditor model.\r\n\r\nRun `python manage.py migrate_schemas` to apply the migration and\r\ncreate the Auditor model.\r\n\r\nUsage and Examples\r\n------------------\r\n\r\nCreate an instance of Audit passing request and the object you want\r\nto log, then call the method create(), update() or delete()\r\nto generate a log with the appropriate action: CREATE, UPDATE or\r\nDELETE.\r\n\r\nFirst you have to import the Audit class:\r\n\r\n.. code-block:: python\r\n\r\n from django_auditor.auditor import Audit\r\n\r\n**New object**\r\n\r\n.. code-block:: python\r\n\r\n new_car = Car(name='Civic', manufacturer='Honda', color='Red')\r\n new_car.save()\r\n auditor = Audit(request, new_car).create()\r\n\r\n|Example Create|\r\n\r\n**Update Object**\r\n\r\n.. code-block:: python\r\n\r\n change_car = Car.objects.get(name='Civic')\r\n auditor = Audit(request, change_car)\r\n change_car.name = 'City'\r\n change_car.color = 'Yellow'\r\n change_car.save()\r\n auditor.update()\r\n\r\n|Example Update|\r\n\r\n**Delete Object**\r\n\r\n.. code-block:: python\r\n\r\n remove_car = Car.objects.get(name='City')\r\n auditor = Audit(request, remove_car)\r\n remove_car.delete()\r\n auditor.delete()\r\n\r\n|Example Delete|\r\n\r\nNow open http://yoursiteURL/auditor to check your logs.\r\n\r\n.. |Example Create| image:: http://brunobastos.net/wp-content/uploads/2016/06/django-auditor-create-example.png\r\n.. |Example Update| image:: http://brunobastos.net/wp-content/uploads/2016/06/django-auditor-update-example.png\r\n.. |Example Delete| image:: http://brunobastos.net/wp-content/uploads/2016/06/django-auditor-delete-example.png", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/brunobastos/django-auditor", "keywords": "django log audit", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-auditor", "package_url": "https://pypi.org/project/django-auditor/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-auditor/", "project_urls": { "Homepage": "https://github.com/brunobastos/django-auditor" }, "release_url": "https://pypi.org/project/django-auditor/1.0/", "requires_dist": null, "requires_python": null, "summary": "This Django app logs changes to models objects in a simple and granular way.", "version": "1.0" }, "last_serial": 2195831, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "b17d66984afffd29a68a6ea71745efcd", "sha256": "9deac6e1a0f789027074bb2f1f1b88c4904b210b6f22120d2bf52a318d5b769b" }, "downloads": -1, "filename": "django-auditor-1.00.tar.gz", "has_sig": false, "md5_digest": "b17d66984afffd29a68a6ea71745efcd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5406, "upload_time": "2016-06-30T03:28:19", "url": "https://files.pythonhosted.org/packages/a0/9d/5cecf4e72cac74f5927ee3e4158300ae0fb4aca332f587aaf58c82617026/django-auditor-1.00.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b17d66984afffd29a68a6ea71745efcd", "sha256": "9deac6e1a0f789027074bb2f1f1b88c4904b210b6f22120d2bf52a318d5b769b" }, "downloads": -1, "filename": "django-auditor-1.00.tar.gz", "has_sig": false, "md5_digest": "b17d66984afffd29a68a6ea71745efcd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5406, "upload_time": "2016-06-30T03:28:19", "url": "https://files.pythonhosted.org/packages/a0/9d/5cecf4e72cac74f5927ee3e4158300ae0fb4aca332f587aaf58c82617026/django-auditor-1.00.tar.gz" } ] }