Apache + Django ModuleNotFoundError: No module named 'project'

I'm having an issue with hosting my Django project with Apache on Windows. The website shows Internal Server Error and I'm getting the following stacktrace after visiting it:

ModuleNotFoundError: No module named 'project'\r
[Sat Aug 27 15:27:15.461267 2022] [wsgi:error] [pid 4664:tid 1944] [client 85.111.111.230:49768] mod_wsgi (pid=4664): Failed to exec Python script file 'C:/Users/Administrator/Desktop/vi_backend/project/wsgi.py'., referer: http://85.111.111.230:8000/
[Sat Aug 27 15:27:15.461267 2022] [wsgi:error] [pid 4664:tid 1944] [client 85.111.111.230:49768] mod_wsgi (pid=4664): Exception occurred processing WSGI script 'C:/Users/Administrator/Desktop/vi_backend/project/wsgi.py'., referer: http://85.111.111.230:8000/

vi_backend is the project root, it contains manage.py etc. Within that folder we have "venv" (virtual environment) and "project" which contains wsgi.py.

Not sure why it is saying there's no module project, as project is not a module.

httpd.conf tail

LoadFile "c:/users/administrator/appdata/local/programs/python/python39/python39.dll"
LoadModule wsgi_module "c:/users/administrator/appdata/local/programs/python/python39/lib/site-packages/mod_wsgi/server/mod_wsgi.cp39-win_amd64.pyd"
WSGIPythonHome "c:/users/administrator/appdata/local/programs/python/python39"
WSGIScriptAlias / "c:/users/administrator/Desktop/vi_backend/project/wsgi.py"
WSGIPythonPath "C:/Users/Administrator/Desktop/vi_backend/venv/Lib/site-packages"
        
<VirtualHost _default_:8000>

    <Directory "c:/users/administrator/Desktop/vi_backend/project">
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

    Alias /static "c:/users/administrator/Desktop/vi_backend/static/"
    <Directory "c:/users/administrator/Desktop/vi_backend/static/">
        Require all granted
    </Directory>
    
    ErrorLog logs/anyFile-error.log
    CustomLog logs/anyFile-access.log common
</VirtualHost>
Back to Top