create view django not saving image
In your Django view, ensure you have the correct import statements:
from django.core.files.storage import default_storage
from django.core.files.base import ContentFile
Make sure your form enctype is set correctly in your template:
<form method="post" enctype="multipart/form-data">
In your Django view, handle the file upload using request.FILES and save it to the desired location:
def your_view(request):
if request.method == 'POST':
file = request.FILES['file']
default_storage.save('path/to/save/file.jpg', ContentFile(file.read()))
Ensure that the file path is correct and that you have write permissions to the specified folder.