I'm getting this error in the below function in my views.py file. I don't know what 'WSGIRequest' is or why it's throwing an error.
Here the settings.MEDIA_ROOT means it will list all the files in that directory
def run_existing_query(request):
context = {}
print(settings.MEDIA_ROOT)
context["download"] = ""
context["list_of_queries"] = os.listdir(settings.MEDIA_ROOT)
if request.method == "POST":
MODULE_DIR = 'settings.MEDIA_ROOT'
py_file = glob.glob(os.path.join(MODULE_DIR,
request['selected_query']+'.py'))
module_name = pathlib.Path(py_file).stem
module = importlib.import_module(module_name)
qe = module.QueryExecutor() #Query executor is Class name
context["download"] = "Hello"
return render(request, "run_existing.html", context)
Why am I getting this error?