1👍
✅
I really see lot of unnecessary code in you views, what your mainly need to do in you view is the following:
# ...
form = CastingForm(request.POST, request.FILES) # request.FILES contains the uploaded files
if form.is_valid():
Casting.objects.create(**form.cleaned_data)
else:
# handels errors in 'form.errors'
# ...
👤Dhia
Source:stackexchange.com