import os

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

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

# load SnapSearch API credentials
api_email = "<email>"
api_key = "<key>"

# initialize the interceptor
from SnapSearch import Client, Detector, Interceptor
interceptor = Interceptor(Client(api_email, api_key), Detector())

# deploy the interceptor
from SnapSearch.wsgi import InterceptorMiddleware
application = InterceptorMiddleware(application, interceptor)

[(3, 'os.environ.setdefault', 'os.environ.setdefault', False, 'import os\n'), (7, 'django.core.wsgi.get_wsgi_application', 'get_wsgi_application', False, 'from django.core.wsgi import get_wsgi_application\n'), (19, 'SnapSearch.wsgi.InterceptorMiddleware', 'InterceptorMiddleware', False, 'from SnapSearch.wsgi import InterceptorMiddleware\n'), (15, 'SnapSearch.Client', 'Client', False, 'from SnapSearch import Client, Detector, Interceptor\n'), (15, 'SnapSearch.Detector', 'Detector', False, 'from SnapSearch import Client, Detector, Interceptor\n')]