{ "info": { "author": "Lars van de Kerkhof", "author_email": "lars@permanentmarkers.nl", "bugtrack_url": null, "classifiers": [], "description": "Deduplicate your uploaded file\n------------------------------\n\nIf making sure your file uploads are never duplicated is more important than\norganising your files into neat folders, you might want to try this package.\n\nUsage\n=====\n\nYou can use the storage backend on a global level by adding the following to\nyour django settings::\n\n DEFAULT_FILE_STORAGE = 'dedupebackend.storage.DedupedStorage'\n\nIf you want to use the other features offered by dedupebackend, you need to add\ndedupebackend to ``INSTALLED_APPS`` like this::\n\n INSTALLED_APPS = [\n 'dedupebackend', # does not matter what spot\n ...\n ]\n\nAdmin integration\n+++++++++++++++++\n\nAdding dedupebackend to ``INSTALLED_APPS`` gives you an admin page where you\ncan check your uploaded files. I allready let you know dedupebackend just\nthrows verything in a large folder, but that does not mean you can not add\nstructure to the storage. Just not on a filesystem level. You should add\nstructure by adding relations to other models. It is easy enough to add\ncategories or something::\n\n class FileCategory(models.Model):\n files = models.ManyToManyField('dedupebackend.UniqueFile')\n name = models.TextField()\n\nIf you want to add a filter to the dedupebackend admin, try something like\nthis::\n\n from dedupebackend.admin import UniqueFileAdmin\n from dedupebackend.models import UniqueFile\n\n admin.site.unregister(UniqueFile)\n \n class CategoryUniqueFileAdmin(UniqueFileAdmin):\n list_filter = UniqueFileAdmin.list_filter + ('filecategory__name',)\n\n admin.site.register(UniqueFile, CategoryUniqueFileAdmin)\n\nthat might need some work, I never tested it :p\n\nfields\n++++++\n\nThere are some fields in dedupebackend you can use instead of the django\n``FileField`` and ``ImageField``. You get a picker added to that, you can use\nto select a file from the existing uploaded files.\n\nUse something like this::\n\n from dedupebackend.fields import *\n\n class KoeHenkModel(model.Model):\n name = models.TextField()\n file = UniqueFileField(\"A normal file, nothing special\")\n image = UniqueImageField(\"an image\")\n\nHow does it work?\n=================\n\nWell, for each uploaded file, dedupebackend creates a file on disk named after\nthe hash of the file. Mostly the same as git does (I actually tried to use\nlibgit2 for this, but git is bad with deletions). Next to that file, a table\nholds a record with some information about the file. The primary key of this\ntable is the hash value of the file. So it is really impossible to add\nduplicates (but but, hash collisions).\n\nThe fields actually render a file form field on a foreign key model field.\nThe storage backend returns the hash value as the file name. And it can return\nfile objects when given such a hash value.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/specialunderwear/django-dedupe-backend", "keywords": "django storage backend that stores files in git", "license": "GPL v3", "maintainer": "", "maintainer_email": "", "name": "django-dedupe-backend", "package_url": "https://pypi.org/project/django-dedupe-backend/", "platform": "", "project_url": "https://pypi.org/project/django-dedupe-backend/", "project_urls": { "Homepage": "https://github.com/specialunderwear/django-dedupe-backend" }, "release_url": "https://pypi.org/project/django-dedupe-backend/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "The super storage backend", "version": "0.0.2" }, "last_serial": 3377692, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "79a7b262df4d57e76f378ee720c095d2", "sha256": "9ace4a0836a5c3433656b9c2f43e30b232f9e9fc8e6a8fba0005dc04f4fce444" }, "downloads": -1, "filename": "django-dedupe-backend-0.0.2.tar.gz", "has_sig": false, "md5_digest": "79a7b262df4d57e76f378ee720c095d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20842, "upload_time": "2017-11-30T15:25:57", "url": "https://files.pythonhosted.org/packages/98/3d/e63b310aed473b0ececebe826699755b4fa008b87cc0406bc3fe3041f133/django-dedupe-backend-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "79a7b262df4d57e76f378ee720c095d2", "sha256": "9ace4a0836a5c3433656b9c2f43e30b232f9e9fc8e6a8fba0005dc04f4fce444" }, "downloads": -1, "filename": "django-dedupe-backend-0.0.2.tar.gz", "has_sig": false, "md5_digest": "79a7b262df4d57e76f378ee720c095d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20842, "upload_time": "2017-11-30T15:25:57", "url": "https://files.pythonhosted.org/packages/98/3d/e63b310aed473b0ececebe826699755b4fa008b87cc0406bc3fe3041f133/django-dedupe-backend-0.0.2.tar.gz" } ] }