How to Solve NameError: name 'SimpleUploadedFile' is not defined -- django

Solution: Import the 'SimpleUploadedFile' module

To Solve the error, add the following line to the top of your code.

from django.core.files.uploadedfile import SimpleUploadedFile

 

For more information:
Python django SimpleUploadedFile