wsgi.py
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gis_api.settings')
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
httpd.conf
ServerName 127.0.0.1:81
LoadFile "C:/Users/test/AppData/Local/Programs/Python/Python310/python310.dll"
LoadModule wsgi_module "C:/Users/test/AppData/Local/Programs/Python/Python310/lib/site-packages/mod_wsgi/server/mod_wsgi.cp310-win_amd64.pyd"
WSGIPythonHome "C:/Users/test/AppData/Local/Programs/Python/Python310"
WSGIPythonPath "C:/Users/test/AppData/Local/Programs/Python/Python310/lib/site-packages/"
<VirtualHost *:81>
WSGIScriptAlias / "D:/django_project/gis_api/gis_api/gis_api/wsgi.py"
<Directory "D:/django_project/gis_api/gis_api/gis_api/">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Alias /static "D:/django_project/gis_api/gis_api/static/"
<Directory "D:/django_project/gis_api/gis_api/static/">
Require all granted
</Directory>
Alias /media "D:/django_project/gis_api/gis_api/media/"
<Directory "D:/django_project/gis_api/gis_api/media/">
Require all granted
</Directory>
</VirtualHost>
error.log
version:
I have try to all solution. But getting error. I am beginner to deployment in django apache. Pl guide me best path of deployment.
WSGIPythonPath needs to point to your app directory like
WSGIPythonPath "D:/django_project/gis_api"
For the moment you are twice adding the environment path (WSGIPythonHome and...Path) to the python search path but not your apps directory.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.