{ "info": { "author": "Derek Kwok", "author_email": "derek.kai.chun.kwok@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "django-db-storage\n=================\n\n.. image:: https://travis-ci.org/derekkwok/django-db-storage.svg?branch=master\n :target: https://travis-ci.org/derekkwok/django-db-storage\n\n.. image:: https://coveralls.io/repos/github/derekkwok/django-db-storage/badge.svg?branch=master \n :target: https://coveralls.io/github/derekkwok/django-db-storage?branch=master\n\n.. image:: https://badge.fury.io/py/django-db-storage.svg\n :target: https://badge.fury.io/py/django-db-storage\n\nOverview\n--------\n\nWarning: In many cases, storing files in the database is a BAD idea. Your database will easily become bloated and the performance can degrade rapidly. See this `StackExchange post`_ for more information.\n\n.. _StackExchange post: http://programmers.stackexchange.com/questions/150669/is-it-a-bad-practice-to-store-large-files-10-mb-in-a-database\n\nThis is a custom storage backend for storing files in the database instead of the file system and is a drop-in replacement for Django's FileSystemStorage. Some benefits of this application:\n\n* no changes needed to existing models, it just works (and if it doesn't, open a ticket!)\n* django-admin is implemented and can be used to search, upload, download and manage files\n* 100% code coverage with unit tests\n\n.. image:: http://i.imgur.com/4g9tmEZt.png\n :target: http://i.imgur.com/4g9tmEZ.png\n\n.. image:: http://i.imgur.com/A2F8xlrt.png\n :target: http://i.imgur.com/A2F8xlr.png\n\nRequirements\n------------\n\n* Python (2.7, 3.4, 3.5)\n* Django (1.8, 1.9)\n\nInstallation\n------------\n\nInstallation using pip::\n\n $ pip install django-db-storage\n\nUpdate ``settings.py``\n\n.. code-block:: python\n\n # Add 'dbstorage' to INSTALLED_APPS\n INSTALLED_APPS = [\n 'dbstorage',\n ]\n\n # Optionally set DEFAULT_FILE_STORAGE\n DEFAULT_FILE_STORAGE = 'dbstorage.storage.DBStorage'\n\n # Choose a root url for uploaded files\n MEDIA_URL = '/media/'\n\nUpdate ``urls.py``\n\n.. code-block:: python\n\n urlpatterns = [\n ...\n dbstorage_url(),\n ]\n\nRun database migrations\n\n::\n\n $ python manage.py migrate\n\n\nHow to Use\n----------\n\nNo modification are needed for models to work properly.\n\n.. code-block:: python\n\n def user_directory_path(instance, filename):\n return 'user_{0}/{1}'.format(instance.user.id, filename)\n\n class MyModel(models.Model):\n\n file_field1 = models.FileField()\n file_field2 = models.FileField(upload_to='uploads/%Y/%m/%d/')\n file_field3 = models.FileField(upload_to=user_directory_path)\n\nBugs?\n-----\n\nCreate an issue at https://github.com/derekkwok/django-db-storage/issues\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/derekkwok/django-db-storage", "keywords": "django metrics analytics", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-db-storage", "package_url": "https://pypi.org/project/django-db-storage/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-db-storage/", "project_urls": { "Homepage": "https://github.com/derekkwok/django-db-storage" }, "release_url": "https://pypi.org/project/django-db-storage/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "Custom Database Storage for Django", "version": "1.0.2" }, "last_serial": 1980898, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "ec476f5f58bee05c8c6a7b0c238097ae", "sha256": "d621cf874d8edebabab7e390c78b9543b8d842b10bc978aa1665a64523af0f6a" }, "downloads": -1, "filename": "django_db_storage-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ec476f5f58bee05c8c6a7b0c238097ae", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6736, "upload_time": "2016-02-25T03:34:00", "url": "https://files.pythonhosted.org/packages/94/b6/d825aa2ca6414597e61b007521927ab5cbf403d6fab52f79583a9f9d0795/django_db_storage-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aa2ada15a4bb358be427ee57f7ba4473", "sha256": "0332b4ad074c69d224946806142a24672c6b5010b76ada55f2b82f93a3d2ed7d" }, "downloads": -1, "filename": "django-db-storage-1.0.0.tar.gz", "has_sig": false, "md5_digest": "aa2ada15a4bb358be427ee57f7ba4473", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5389, "upload_time": "2016-02-25T03:34:15", "url": "https://files.pythonhosted.org/packages/ce/e0/e89d8be26dac1d2fb4d4144919bca369a7dc78d5849cae1f332b76a0b747/django-db-storage-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "999a10fd8b72677c6541b2a8d94590e0", "sha256": "f147b209bddc432a4c32bde84c40eb571e6bdbc156414ce6038e5d13a7ac2806" }, "downloads": -1, "filename": "django_db_storage-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "999a10fd8b72677c6541b2a8d94590e0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7178, "upload_time": "2016-02-27T02:12:56", "url": "https://files.pythonhosted.org/packages/49/bb/0b7bc96f6ad983e6b1fc2c1fc9a3121d1c9f1b6ea81f27bdc62f3e0f421c/django_db_storage-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9248489d47661d959d73d4c0c6f54563", "sha256": "0573d3cd03285e0227606d6c921c4025062cd5a3afc5f03698e4027acea90e07" }, "downloads": -1, "filename": "django-db-storage-1.0.1.tar.gz", "has_sig": false, "md5_digest": "9248489d47661d959d73d4c0c6f54563", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5827, "upload_time": "2016-02-27T02:13:01", "url": "https://files.pythonhosted.org/packages/af/07/a5d8ffffec104fce4c7de09f26e6110aa43a88e03af20be345f8cc960e41/django-db-storage-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "4208a5134841ea4195695de054060a13", "sha256": "21cf8f1e98e6c0bbd3016c4d8a41dcfd1a02ba6de828b6735469a1a593bf83a2" }, "downloads": -1, "filename": "django_db_storage-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4208a5134841ea4195695de054060a13", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7191, "upload_time": "2016-02-28T18:51:38", "url": "https://files.pythonhosted.org/packages/04/38/c8fc4dcd6ea2c9fad7ea379fc7b583e83629e744bd6e1ee9eb2c31bc1589/django_db_storage-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97fd409ed25c024b7d1538dd21062113", "sha256": "f49af3fb11e34f8c52de170e6b8ed1b4203fe2ab9e2996789371617df9ed98e5" }, "downloads": -1, "filename": "django-db-storage-1.0.2.tar.gz", "has_sig": false, "md5_digest": "97fd409ed25c024b7d1538dd21062113", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5838, "upload_time": "2016-02-28T18:51:47", "url": "https://files.pythonhosted.org/packages/fb/b2/ec06608f1e086dbc06cfb46c722bbc7430a4a8fd966a784d514165bff8a7/django-db-storage-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4208a5134841ea4195695de054060a13", "sha256": "21cf8f1e98e6c0bbd3016c4d8a41dcfd1a02ba6de828b6735469a1a593bf83a2" }, "downloads": -1, "filename": "django_db_storage-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4208a5134841ea4195695de054060a13", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7191, "upload_time": "2016-02-28T18:51:38", "url": "https://files.pythonhosted.org/packages/04/38/c8fc4dcd6ea2c9fad7ea379fc7b583e83629e744bd6e1ee9eb2c31bc1589/django_db_storage-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97fd409ed25c024b7d1538dd21062113", "sha256": "f49af3fb11e34f8c52de170e6b8ed1b4203fe2ab9e2996789371617df9ed98e5" }, "downloads": -1, "filename": "django-db-storage-1.0.2.tar.gz", "has_sig": false, "md5_digest": "97fd409ed25c024b7d1538dd21062113", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5838, "upload_time": "2016-02-28T18:51:47", "url": "https://files.pythonhosted.org/packages/fb/b2/ec06608f1e086dbc06cfb46c722bbc7430a4a8fd966a784d514165bff8a7/django-db-storage-1.0.2.tar.gz" } ] }