import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings.tomodev")

# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)

import os
import site

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings.tomodev")

base_path = os.path.abspath("../..")
site.addsitedir(base_path)
site.addsitedir(os.path.join(base_path, 'virtualenv/lib/python2.6/site-packages'))

# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)

Set Python path inside WSGI application
Set Python path inside WSGI application
  import os
+ import site
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings.tomodev")
+ 
+ base_path = os.path.abspath("../..")
+ site.addsitedir(base_path)
+ site.addsitedir(os.path.join(base_path, 'virtualenv/lib/python2.6/site-packages'))
  
  # This application object is used by any WSGI server configured to use this
  # file. This includes Django's development server, if the WSGI_APPLICATION
  # setting points here.
  from django.core.handlers.wsgi import WSGIHandler
  application = WSGIHandler()
  
  # Apply WSGI middleware here.
  # from helloworld.wsgi import HelloWorldApplication
  # application = HelloWorldApplication(application)
  
Set Python path inside WSGI application
## Code Before:
import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings.tomodev")

# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)

## Instruction:
Set Python path inside WSGI application
## Code After:
import os
import site

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings.tomodev")

base_path = os.path.abspath("../..")
site.addsitedir(base_path)
site.addsitedir(os.path.join(base_path, 'virtualenv/lib/python2.6/site-packages'))

# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
