1👍
✅
Try this
from django.core.files import File
a.headshot.save('abc.jpg', File(open('/tmp/pic.jpg', 'r')))
0👍
FileNotFoundError: [Errno 2] No such file or directory: '/pyproject/mysite/tmp/pic.jpg'
Just see where python is looking for the file.
Please copy the pic.jpg file in same directory where you are running shell command it will work for sure then.
- Change the css class of an element in a Django form that uses ModelForm
- How to let website admin save new content
- HighChart pie does not display any data
Source:stackexchange.com