Error deploying django project using apache + mod_wsgi (locally)

Hello, this is my first time deploy django project locally using apache and mod_wsgi.

i have install mod_wsgi and this is my configuration in httpd.conf for apache :

LoadFile "C:/Python310/python310.dll"
LoadModule wsgi_module "C:/Python310/lib/site-packages/mod_wsgi/server/mod_wsgi.cp310-win_amd64.pyd"

WSGIPythonHome C:/Python310
WSGIScriptAlias / D:/keda/keda/keda/wsgi.py
WSGIPythonPath D:/keda/keda/

    <Directory D:/keda/keda/keda>
		<Files wsgi.py>
			Options +ExecCGI
        	    	Require all granted
		</Files>
	</Directory>
ErrorLog D:/keda/apache.error.log
CustomLog D:/keda/apache.custom.log common

but i get this 500 error said :
[Tue Jan 31 17:29:55.338770 2023] [cgi:error] [pid 11320:tid 1948] (9)Bad file descriptor: [client ::1:59107] AH01222: don’t know how to spawn child process: D:/keda/keda/keda/wsgi.py, referer: http://localhost/

anyone know how to fix this error?
because if i do #! or ! in wsgi.py it’s not readable

Are there any more error messages in any of the Apache-related log files?

By running this in mod_wsgi, this is not a CGI interface, try removing that option from the Files section of your configuration.

Please be more specific here. What are you trying to use as the #! line in your file? What are the exact error message(s) you’re receiving?

Also note that:

should not have a trailing slash.

Finally, I’m not sure that you can use a pyd file as a LoadModule. I would expect that to be a dll on Windows or an so on Linux.

i solved it!, thank you btw. the key is your answer. so i remove the cgi and in he cgi config i remove .py, because it’s loaded by python, not cgi