Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 32 lines (29 sloc) 1.279 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#!/usr/bin/env python
from django.core.management import execute_manager
try:
    import settings # Assumed to be in the same directory.
except ImportError:
    import sys
    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
    sys.exit(1)

if __name__ == "__main__":
    try:
        execute_manager(settings)
    except Exception, e:
        # Custom handling of exceptions to make sure
        # that Sentry handles them.
        import sys, traceback
        if sys.stdout.isatty():
            traceback.print_exc()
        else:
            if settings.DEBUG or not 'sentry.client' in settings.INSTALLED_APPS:
                raise
            from sentry.client.models import get_client
            exc_info = sys.exc_info()
            if getattr(exc_info[0], 'skip_sentry', False):
                raise
            get_client().create_from_exception(exc_info)
            
            # Email admins
            import logging
            logger = logging.getLogger('management_commands')
            logger.exception(e)
Something went wrong with that request. Please try again.