Last active
May 30, 2019 07:20
-
-
Save ahmadalsajid/894bdb275f11a83e4a39705b5293c721 to your computer and use it in GitHub Desktop.
mod_wsgi with apache to serve Django application on windows server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import site | |
from django.core.wsgi import get_wsgi_application | |
# add python site packages, you can use virtualenvs also | |
site.addsitedir("C:/Program files/python36/Lib/site-packages") | |
# Add the app's directory to the PYTHONPATH | |
sys.path.append('C:/Users/Administrator/Desktop/my_project') | |
sys.path.append('C:/Users/Administrator/Desktop/my_project/my_project') | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'my_project.settings' | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_project.settings") | |
application = get_wsgi_application() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment