I have a Django Site running on an Apache server which is running with no errors but when i serach for localhost it loads forever and doesn't give a 404 response or anything. Any idea what i am doing wrong?
Also, i am doing this using Apache and mod_wsgi.
httpd.conf
Define SRVROOT "c:/Apache24"
ServerName localhost
Include conf/extra/httpd-vhosts.conf
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"
httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
WSGIScriptAlias / "C:/Users/Administrator/Desktop/myapp/myapp/wsgi_windows.py"
<Directory "C:/Users/Administrator/Desktop/myapp/myapp/">
<Files wsgi_windows.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
wsgi_windows.py
import os
import sys
import site
from django.core.wsgi import get_wsgi_application
sys.path.append('C:/Users/Administrator/Desktop/myapp/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myapp.settings')
application = get_wsgi_application()
For anyone who gets a similar problem in the future, i used WSGIApplicationGroup %{GLOBAL} which i found out about here and it now works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With