Last active
December 11, 2015 12:19
-
-
Save drawcode/4600159 to your computer and use it in GitHub Desktop.
django apache mod_wsgi config
This file contains hidden or 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
| <VirtualHost *:80> | |
| DocumentRoot D:/http/mysite-com | |
| WSGIScriptAlias / D:/http/mysite-com/apache/django.wsgi | |
| ServerName mysite.com | |
| </VirtualHost> |
This file contains hidden or 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, sys | |
| #Calculate the path based on the location of the WSGI script. | |
| apache_configuration= os.path.dirname(__file__) | |
| project = os.path.dirname(apache_configuration) | |
| workspace = os.path.dirname(project) | |
| sys.path.append(workspace) | |
| sys.path.append('D:/django-sites') | |
| sys.path.append(['D:/django-sites'] + sys.path) | |
| sys.path.append('D:/django-sites/mysite_com') | |
| os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite_com.settings' | |
| import django.core.handlers.wsgi | |
| application = django.core.handlers.wsgi.WSGIHandler() |
This file contains hidden or 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, sys | |
| #Calculate the path based on the location of the WSGI script. | |
| apache_configuration= os.path.dirname(__file__) | |
| project = os.path.dirname(apache_configuration) | |
| workspace = os.path.dirname(project) | |
| site = 'mysite' | |
| site_code = site + '_com' | |
| site_path = 'E:/http/django-sites' | |
| sys.path.append(workspace) | |
| sys.path.append(site_path) | |
| sys.path.append([site_path] + sys.path) | |
| sys.path.append(site_path + site_code ) | |
| os.environ['DJANGO_SETTINGS_MODULE'] = site_code + '.settings' | |
| import django.core.handlers.wsgi | |
| application = django.core.handlers.wsgi.WSGIHandler() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment