"""
WSGI config for mysite project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see Django docs.
"""
import os
import sys

#sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
#sys.path.append('/var/www/mysite') 

rootdir = os.path.join(os.path.dirname(__file__),'..')
sys.path.insert(0, rootdir)


import time 
import traceback 
import signal 
from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")

try: 
    application = get_wsgi_application() 
except Exception: 
    # Error loading applications 
    if 'mod_wsgi' in sys.modules: 
        traceback.print_exc() 
        os.kill(os.getpid(), signal.SIGINT) 
        time.sleep(2.5) 


