Kaydet (Commit) 36d1e372 authored tarafından Vishal Lal's avatar Vishal Lal Kaydeden (comit) Tim Graham

[1.7.x] Fixed #22347 -- Unified FileSystemStorage documentation.

Thanks nliberg for the report.

Backport of ca93f02c from master
üst cfb7eca2
...@@ -36,6 +36,16 @@ The FileSystemStorage Class ...@@ -36,6 +36,16 @@ The FileSystemStorage Class
:class:`~django.core.files.storage.Storage` and provides implementations :class:`~django.core.files.storage.Storage` and provides implementations
for all the public methods thereof. for all the public methods thereof.
.. attribute:: location
Absolute path to the directory that will hold the files.
Defaults to the value of your :setting:`MEDIA_ROOT` setting.
.. attribute:: base_url
URL that serves the files stored at this location.
Defaults to the value of your :setting:`MEDIA_URL` setting.
.. attribute:: file_permissions_mode .. attribute:: file_permissions_mode
The file system permissions that the file will receive when it is The file system permissions that the file will receive when it is
......
...@@ -149,20 +149,8 @@ See :doc:`/ref/files/storage` for the file storage API. ...@@ -149,20 +149,8 @@ See :doc:`/ref/files/storage` for the file storage API.
The built-in filesystem storage class The built-in filesystem storage class
------------------------------------- -------------------------------------
Django ships with a built-in ``FileSystemStorage`` class (defined in Django ships with a :class:`django.core.files.storage.FileSystemStorage` class
``django.core.files.storage``) which implements basic local filesystem file which implements basic local filesystem file storage.
storage. Its initializer takes two arguments:
====================== ===================================================
Argument Description
====================== ===================================================
``location`` Optional. Absolute path to the directory that will
hold the files. If omitted, it will be set to the
value of your :setting:`MEDIA_ROOT` setting.
``base_url`` Optional. URL that serves the files stored at this
location. If omitted, it will default to the value
of your :setting:`MEDIA_URL` setting.
====================== ===================================================
For example, the following code will store uploaded files under For example, the following code will store uploaded files under
``/media/photos`` regardless of what your :setting:`MEDIA_ROOT` setting is:: ``/media/photos`` regardless of what your :setting:`MEDIA_ROOT` setting is::
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment