Statistics
| Branch: | Tag: | Revision:

root / poller / application.py @ 0f03076d

History | View | Annotate | Download (464 Bytes)

1 3e99e2d1 Leonidas Poulopoulos
#!/usr/bin/python
2 3e99e2d1 Leonidas Poulopoulos
from gevent import monkey; monkey.patch_all()
3 3e99e2d1 Leonidas Poulopoulos
import os
4 3e99e2d1 Leonidas Poulopoulos
import traceback
5 3e99e2d1 Leonidas Poulopoulos
from django.core.handlers.wsgi import WSGIHandler
6 3e99e2d1 Leonidas Poulopoulos
from django.core.signals import got_request_exception
7 3e99e2d1 Leonidas Poulopoulos
from django.core.management import call_command
8 3e99e2d1 Leonidas Poulopoulos
9 3e99e2d1 Leonidas Poulopoulos
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
10 3e99e2d1 Leonidas Poulopoulos
11 3e99e2d1 Leonidas Poulopoulos
def exception_printer(sender, **kwargs):
12 3e99e2d1 Leonidas Poulopoulos
    traceback.print_exc()
13 3e99e2d1 Leonidas Poulopoulos
14 3e99e2d1 Leonidas Poulopoulos
got_request_exception.connect(exception_printer)
15 3e99e2d1 Leonidas Poulopoulos
call_command('syncdb')
16 3e99e2d1 Leonidas Poulopoulos
17 3e99e2d1 Leonidas Poulopoulos
application = WSGIHandler()