django-dbfilestorage/docs/dbfilestorage/installation.rst
Tyrel Souza 93df8c6939 Documentation (#5)
Add a lot of missing documentation

* try codeblock

* code

* backticks

* markdown, not rst

* examples

* unindent

* stub out docs

* change theme, add docs for installation

* More documentation

* remove debug print

* flake8
2016-12-08 13:43:12 -05:00

30 lines
692 B
ReStructuredText

Installation
============
In your project's `settings.py` file, add `'dbfilestorage'` to your `INSTALLED_APPS`:
.. code:: python
INSTALLED_APPS = (
...
'dbfilestorage'
)
Next, if you want to set this globally, set the setting:
.. code:: python
DEFAULT_FILE_STORAGE='dbfilestorage.storage.DBFileStorage'
Or you can set it individually on a field: `Django Docs <https://docs.djangoproject.com/en/1.10/ref/models/fields/#django.db.models.FileField.storage>`_
.. code:: python
from dbfilestorage.storage import DBFileStorage
class SomeClass(models.Model):
file = models.FileField(upload_to=u'anywhere',
storage=DBFileStorage())