"""
WSGI config for dictionaries project.

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, sys, site
from django.core.wsgi import get_wsgi_application

python_lib_path = '/DATA/DICTIONARIES/venv/lib/python3.5/site-packages'
env_root_path = '/DATA/DICTIONARIES/venv'
app_root_path = '/DATA/DICTIONARIES/dictionaries'

sys.path.insert(0, app_root_path)
sys.path.insert(0, env_root_path)
sys.path.insert(0, python_lib_path)

# Add the site-packages of the chosen virtualenv to work with
site.addsitedir(python_lib_path)

# Activate your virtual env
activate_env=os.path.expanduser(os.path.join(env_root_path, "bin/activate_this.py"))
with open(activate_env) as f:
	code = compile(f.read(), activate_env, 'exec')
	exec(code)

#os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dictionaries.settings')
os.environ['DJANGO_SETTINGS_MODULE'] = 'dictionaries.settings'

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
