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, 0, 3, 71), 'os.environ.setdefault', 'os.environ.setdefault', ({(3, 22, 3, 46): '"""DJANGO_SETTINGS_MODULE"""', (3, 48, 3, 70): '"""hello_world.settings"""'}, {}), "('DJANGO_SETTINGS_MODULE', 'hello_world.settings')", False, 'import os\n'), ((7, 14, 7, 36), 'django.core.wsgi.get_wsgi_application', 'get_wsgi_application', ({}, {}), '()', False, 'from django.core.wsgi import get_wsgi_application\n'), ((19, 14, 19, 61), 'SnapSearch.wsgi.InterceptorMiddleware', 'InterceptorMiddleware', ({(19, 36, 19, 47): 'application', (19, 49, 19, 60): 'interceptor'}, {}), '(application, interceptor)', False, 'from SnapSearch.wsgi import InterceptorMiddleware\n'), ((15, 26, 15, 52), 'SnapSearch.Client', 'Client', ({(15, 33, 15, 42): 'api_email', (15, 44, 15, 51): 'api_key'}, {}), '(api_email, api_key)', False, 'from SnapSearch import Client, Detector, Interceptor\n'), ((15, 54, 15, 64), 'SnapSearch.Detector', 'Detector', ({}, {}), '()', False, 'from SnapSearch import Client, Detector, Interceptor\n')]