Fixed #30695 -- Used relative path in default_storage docs example.
This commit is contained in:
parent
22394bd3a1
commit
1e429df748
|
@ -143,14 +143,14 @@ useful -- you can use the global default storage system::
|
||||||
>>> from django.core.files.base import ContentFile
|
>>> from django.core.files.base import ContentFile
|
||||||
>>> from django.core.files.storage import default_storage
|
>>> from django.core.files.storage import default_storage
|
||||||
|
|
||||||
>>> path = default_storage.save('/path/to/file', ContentFile('new content'))
|
>>> path = default_storage.save('path/to/file', ContentFile(b'new content'))
|
||||||
>>> path
|
>>> path
|
||||||
'/path/to/file'
|
'path/to/file'
|
||||||
|
|
||||||
>>> default_storage.size(path)
|
>>> default_storage.size(path)
|
||||||
11
|
11
|
||||||
>>> default_storage.open(path).read()
|
>>> default_storage.open(path).read()
|
||||||
'new content'
|
b'new content'
|
||||||
|
|
||||||
>>> default_storage.delete(path)
|
>>> default_storage.delete(path)
|
||||||
>>> default_storage.exists(path)
|
>>> default_storage.exists(path)
|
||||||
|
|
Loading…
Reference in New Issue