When a user uploads a file using forms.FileField, you usually want to save it in some way.
To stash the file away on disk, just use the following snippet.
1.
from
django.core.files.storage
import
default_storage
2.
from
django.core.files.base
import
ContentFile
3.
4.
file
=
request.FILES[
'your_file_fieldname'
]
5.
path
=
default_storage.save(
'heart_of_the_swarm.txt'
, ContentFile(file.read()))
There you have it!
Now back to more important things, like eating cheerleaders.