Skip to content

Instantly share code, notes, and snippets.

@klen
Created July 30, 2011 08:46
Show Gist options
  • Save klen/1115338 to your computer and use it in GitHub Desktop.
Save klen/1115338 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import os
from django.core.handlers.wsgi import WSGIHandler
# Celery settings:
os.environ['CELERY_LOADER'] = 'django'
os.environ['DJANGO_SETTINGS_MODULE'] = os.environ.get('DJANGO_SETTINGS_MODULE', 'settings.dev')
application = WSGIHandler()
if ( 'dev' in os.environ['DJANGO_SETTINGS_MODULE'] or
'local' in os.environ['DJANGO_SETTINGS_MODULE'] ):
from werkzeug.debug import DebuggedApplication
from django.views import debug
def null_technical_500_response(request, exc_type, exc_value, tb):
raise exc_type, exc_value, tb
debug.technical_500_response = null_technical_500_response
application = DebuggedApplication(application, evalex=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment