{ "info": { "author": "Roger Hunwicks", "author_email": "roger@tonic-solutions.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 6 - Mature", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "\nDjango Binary Database Files\n============================\n\n[![](https://img.shields.io/pypi/v/django-binary-database-files.svg)](https://pypi.python.org/pypi/django-binary-database-files) [![Build Status](https://img.shields.io/travis/kimetrica/django-binary-database-files.svg?branch=master)](https://travis-ci.org/kimetrica/django-binary-database-files/) [![](https://pyup.io/repos/github/kimetrica/django-binary-database-files/shield.svg)](https://pyup.io/repos/github/kimetrica/django-binary-database-files)\n\nThis is a storage system for Django that stores uploaded\nfiles in binary fields in the database. Files can be served from the database\n(usually a bad idea), the file system, or a CDN.\n\nWARNING: It is generally a bad idea to serve static files from Django,\nbut there are some valid use cases. If your Django app is behind a caching\nreverse proxy and you need to scale your application servers, it may be\nsimpler to store files in the database.\n\nBased upon django-database-files by [Kimetrica](https://github.com/kimetrica/django-database-files), [rhunwicks](https://github.com/rhunwicks/django-database-files), [chrisspen](https://github.com/chrisspen/django-database-files-3000), [bfirsh](https://github.com/bfirsh/django-database-files) but updated to work with Django 1.11-2.1, Python 2/3 and to use a binary field for storage.\n\nRequires:\n\n * Django 1.11 - 2.1\n\nInstallation\n------------\n\nSimply install via pip with:\n\n pip install django-binary-database-files\n\nUsage\n-----\n\nIn `settings.py`, add `binary_database_files` to your `INSTALLED_APPS` and add\nthis line:\n\n DEFAULT_FILE_STORAGE = 'binary_database_files.storage.DatabaseStorage'\n\nNote, the `upload_to` parameter is still used to synchronize the files stored\nin the database with those on the file system, so new and existing fields\nshould still have a value that makes sense from your base media directory.\n\nIf you are adding the package to an existing Django installation with pre-existing\nfiles, run:\n\n python manage.py binary_database_files_load\n\nAdditionally, if you want to export all files in the database back to the file\nsystem, run:\n\n python manage.py binary_database_files_dump\n\nNote, that when a field referencing a file is cleared, the corresponding file\nin the database and on the file system will not be automatically deleted.\nTo delete all files in the database and file system not referenced by any model\nfields, run:\n\n python manage.py binary_database_files_cleanup\n\nSettings\n-------\n\n* `DB_FILES_AUTO_EXPORT_DB_TO_FS` = `True`|`False` (default `True`)\n\n If true, when a file is uploaded or read from the database, a copy will be\n exported to your media directory corresponding to the FileField's upload_to\n path, just as it would with the default Django file storage.\n\n If false, the file will only exist in the database.\n\n* `DATABASE_FILES_URL_METHOD` = `URL_METHOD_1`|`URL_METHOD_1` (default `URL_METHOD_1`)\n\n Defines the method to use when rendering the web-accessible URL for a file.\n\n If `URL_METHOD_1`, assumes all files have been exported to the filesystem and\n uses the path corresponding to your `settings.MEDIA_URL`.\n\n If `URL_METHOD_2`, uses the URL bound to the `database_file` view\n to dynamically lookup and serve files from the filesystem or database.\n\n In this case, you will also need to updates your `urls.py` to include the view\n that serves the files:\n\n urlpatterns = patterns('',\n # ... the rest of your URLconf goes here ...\n\n # Serve Database Files directly\n url(r'', include('binary_database_files.urls')),\n )\n\n* `DATABASE_FILES_BASE_URL`\n\n Allows the `url` method of the storage backend to return an absolute URL if provided.\n\n\nDevelopment\n-----------\n\nCode should be linted with:\n\n ./pep8.sh\n\nTests require the Python development headers to be installed, which you can install on Ubuntu with:\n\n sudo apt-get install python-dev python3-dev python3.6-dev\n\nTo run unittests across multiple Python versions, install:\n\n sudo apt-get install python3.5-minimal python3.5-dev python3.6-minimal python3.6-dev\n\nTo run all [tests](http://tox.readthedocs.org/en/latest/):\n\n export TESTNAME=; tox\n\nTo run tests for a specific environment (e.g. Python 2.7 with Django 1.11):\n\n export TESTNAME=; tox -e py27-django111\n\nTo run a specific test:\n\n export TESTNAME=.test_adding_file; tox -e py27-django111\n\nTo build and deploy a versioned package to PyPI, verify [all unittests are passing](https://travis-ci.com/kimetrica/django-binary-database-files/), then increase (and commit) the version number in `binary_database_files/__init__.py` and then run:\n\n python setup.py sdist\n python setup.py sdist upload\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kimetrica/django-binary-database-files/", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-binary-database-files", "package_url": "https://pypi.org/project/django-binary-database-files/", "platform": "", "project_url": "https://pypi.org/project/django-binary-database-files/", "project_urls": { "Homepage": "https://github.com/kimetrica/django-binary-database-files/" }, "release_url": "https://pypi.org/project/django-binary-database-files/1.0.8/", "requires_dist": null, "requires_python": "", "summary": "A storage system for Django that stores uploaded files in both the database and file system.", "version": "1.0.8" }, "last_serial": 5238611, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "4dfe90ac7e68e65f523166a87c9c3def", "sha256": "42cf147093eae9aba0eda60ae5bd075556f6c62adb0c0e0f62656da86e91b75c" }, "downloads": -1, "filename": "django-binary-database-files-1.0.3.tar.gz", "has_sig": false, "md5_digest": "4dfe90ac7e68e65f523166a87c9c3def", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23635, "upload_time": "2019-02-04T12:36:00", "url": "https://files.pythonhosted.org/packages/1d/58/2187632468d570bf9609a219020acb1a44b6a671082b7d983c6414881500/django-binary-database-files-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "3c525d720539bbc275ea72f8eaf9fb3c", "sha256": "e16af0154dc1340ba0f40e4324a5f69d6ce50bbced09d9fca5b3cf479d2c87cd" }, "downloads": -1, "filename": "django-binary-database-files-1.0.4.tar.gz", "has_sig": false, "md5_digest": "3c525d720539bbc275ea72f8eaf9fb3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25481, "upload_time": "2019-02-04T12:43:21", "url": "https://files.pythonhosted.org/packages/1d/ee/5a87c6431226f35462ffaaa39ecef72506a774c0b53ca107702376c08c5b/django-binary-database-files-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "c78e8e941c05a0962f2a8948403e32cb", "sha256": "e3391c76a4ac3afa583a7aae49a19f3460af09358a20d9dda292e90c532dd4b1" }, "downloads": -1, "filename": "django-binary-database-files-1.0.5.tar.gz", "has_sig": false, "md5_digest": "c78e8e941c05a0962f2a8948403e32cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25551, "upload_time": "2019-02-04T12:46:04", "url": "https://files.pythonhosted.org/packages/0e/a4/a4aec525639e1397729feb258365ef755464b5eaf3d16a8670e4cb1913a5/django-binary-database-files-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "6aba265ee4f162f74e58f05cc8c7997b", "sha256": "433bc9a28b4e1eb9b299002d109645eddd31f65831e551b620fcf7a6eea4cc22" }, "downloads": -1, "filename": "django-binary-database-files-1.0.6.tar.gz", "has_sig": false, "md5_digest": "6aba265ee4f162f74e58f05cc8c7997b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30416, "upload_time": "2019-03-06T09:14:04", "url": "https://files.pythonhosted.org/packages/45/6b/260ffa0489eb5fdd90548a5208ad90dce3e2fe4ff2fc521c015ac6d8c7fc/django-binary-database-files-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "b6212791cfe9060084fe6e3e5a50bd47", "sha256": "a3ee22cf503208d028760dcf87971df2a1f6ae067b26f26636d16330a3368b25" }, "downloads": -1, "filename": "django-binary-database-files-1.0.7.tar.gz", "has_sig": false, "md5_digest": "b6212791cfe9060084fe6e3e5a50bd47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30948, "upload_time": "2019-03-26T17:37:17", "url": "https://files.pythonhosted.org/packages/f8/b9/28efe340a32907a8f126639a5e0182e88f9d6691d8dd342502edba1ca098/django-binary-database-files-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "4046c37eeeb0f7b0494ae75b800050de", "sha256": "f85519e2eaab280c0646e3fd1ac9f02f93777fbabcd00de766f4d2e32b41abcb" }, "downloads": -1, "filename": "django-binary-database-files-1.0.8.tar.gz", "has_sig": false, "md5_digest": "4046c37eeeb0f7b0494ae75b800050de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31500, "upload_time": "2019-05-07T14:52:43", "url": "https://files.pythonhosted.org/packages/d3/6b/6ac1fc2d7471544211dbb87a4c4c5d06ecd1a5e62a378eeac75223dcc28f/django-binary-database-files-1.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4046c37eeeb0f7b0494ae75b800050de", "sha256": "f85519e2eaab280c0646e3fd1ac9f02f93777fbabcd00de766f4d2e32b41abcb" }, "downloads": -1, "filename": "django-binary-database-files-1.0.8.tar.gz", "has_sig": false, "md5_digest": "4046c37eeeb0f7b0494ae75b800050de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31500, "upload_time": "2019-05-07T14:52:43", "url": "https://files.pythonhosted.org/packages/d3/6b/6ac1fc2d7471544211dbb87a4c4c5d06ecd1a5e62a378eeac75223dcc28f/django-binary-database-files-1.0.8.tar.gz" } ] }