mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
[2.2.x] Fixed #30695 -- Used relative path in default_storage docs example.
Backport of 1e429df748
from master
This commit is contained in:
parent
4a24fe940e
commit
0dc3ad163a
1 changed files with 3 additions and 3 deletions
|
@ -143,14 +143,14 @@ useful -- you can use the global default storage system::
|
|||
>>> from django.core.files.base import ContentFile
|
||||
>>> 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/to/file'
|
||||
'path/to/file'
|
||||
|
||||
>>> default_storage.size(path)
|
||||
11
|
||||
>>> default_storage.open(path).read()
|
||||
'new content'
|
||||
b'new content'
|
||||
|
||||
>>> default_storage.delete(path)
|
||||
>>> default_storage.exists(path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue