Last active
August 29, 2015 14:10
-
-
Save h4/bce0a8ffdaf4f1383fc0 to your computer and use it in GitHub Desktop.
wsgy for shared hosting
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
Options +FollowSymLinks | |
AddType image/svg+xml svg | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.wsgi/$1 [L,QSA] |
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 | |
from datetime import datetime | |
root_path = os.path.abspath(os.path.split(__file__)[0]) | |
f = open('/pub/home/eifmanballet/new/wsgi.log', 'a') | |
try: | |
system_packages = sys.path[-1] | |
sys.path = sys.path[:-1] | |
sys.path.append('/pub/home/eifmanballet/new/.envs/eifman/lib/python2.7/site-packages/') | |
sys.path.append('/pub/home/eifmanballet/new/htdocs/eifmanballet/') | |
sys.path.append(system_packages) | |
os.environ['SECRET_KEY'] = 'eifmanballetsettingsproduction' | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'eifmanballet.settings.staging' | |
# os.environ['DJANGO_SETTINGS_MODULE'] = 'eifmanballet.settings.production' | |
# os.environ['DJANGO_SETTINGS_MODULE'] = 'eifmanballet.settings.test' | |
from django.core.wsgi import get_wsgi_application | |
application = get_wsgi_application() | |
except Exception as e: | |
f.write("%s %s" % (datetime.now(), e.message)) | |
f.write("\n") | |
f.write("Loaded at {}\n".format(datetime.now())) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment