0
My code is like this
Em Views:
def cadastrar(request):
if request.method == 'POST':
arquivo = request.FILES["imagem"]
leitura = arquivo.read()
if form.is_valid():
form.save()
The form is saved only if the command leitura = arquivo.read()
be commented #.
If it is not commented, after the execution of that line, the form is invalid.
Does anyone know why this is happening?
I’m using Django 3.2.3