import os

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

# 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.wsgi import get_wsgi_application
application = get_wsgi_application()

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

import sys
import os
from os.path import dirname

sys.path.append(dirname(dirname(__file__)))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "federez_ldap.settings")

# 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.wsgi import get_wsgi_application
application = get_wsgi_application()

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

Append app path to Python path in WSGI
Append app path to Python path in WSGI

+ import sys
  import os
+ from os.path import dirname
  
+ sys.path.append(dirname(dirname(__file__)))
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "federez_ldap.settings")
  
  # 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.wsgi import get_wsgi_application
  application = get_wsgi_application()
  
  # Apply WSGI middleware here.
  # from helloworld.wsgi import HelloWorldApplication
  # application = HelloWorldApplication(application)
  
Append app path to Python path in WSGI
## Code Before:
import os

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

# 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.wsgi import get_wsgi_application
application = get_wsgi_application()

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

## Instruction:
Append app path to Python path in WSGI
## Code After:
import sys
import os
from os.path import dirname

sys.path.append(dirname(dirname(__file__)))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "federez_ldap.settings")

# 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.wsgi import get_wsgi_application
application = get_wsgi_application()

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