diff options
author | lxf <sng@luxagraf.net> | 2019-05-02 15:37:51 +0000 |
---|---|---|
committer | lxf <sng@luxagraf.net> | 2019-05-02 15:37:51 +0000 |
commit | 29520016f9039c669f725d693de22cdda8445e23 (patch) | |
tree | 3de82673e4edd7694b28da94796e247097c5da23 /config/wsgi.py | |
parent | 9d73326aad4d9aee61a16f7274819fa93f32dc72 (diff) |
added wsgi.py
Diffstat (limited to 'config/wsgi.py')
-rw-r--r-- | config/wsgi.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/config/wsgi.py b/config/wsgi.py index 0c727f0..a867734 100644 --- a/config/wsgi.py +++ b/config/wsgi.py @@ -1,16 +1,17 @@ -""" -WSGI config for myproj project. +import os, sys, site +from os.path import dirname, abspath +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ -""" - -import os +# Fix markdown.py (and potentially others) using stdout +sys.stdout = sys.stderr +SERVER_ROOT = abspath(dirname(dirname(__file__)))+'/' +# Tell wsgi to add the Python site-packages to it's path. +site.addsitedir(SERVER_ROOT+'venv/lib/python3.6/site-packages') +sys.path = [SERVER_ROOT,] + sys.path +sys.path.insert(0, os.path.join(SERVER_ROOT, "apps")) +sys.path.insert(0, os.path.join(SERVER_ROOT, "apps/lib")) +sys.path.insert(0, os.path.join(SERVER_ROOT, "config")) from django.core.wsgi import get_wsgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproj.settings') - application = get_wsgi_application() + |