Beispiel #1
0
        settings = get_settings()
    except SettingsImportError, exc:
        print >> sys.stderr, exc.args[0]
        print >> sys.stderr
        print >> sys.stderr, "The original exception was:"
        print >> sys.stderr, '\t' + str(exc.args[1])
        sys.exit(1)

    from django.core import management as mgmt
    mgmt.setup_environ(settings)

    commands = find_all_commands(settings.INSTALLED_APPS)

    from djboss.parser import PARSER

    PARSER.set_defaults(settings=settings)
    if settings.DEBUG:
        PARSER.set_defaults(log_level='DEBUG')
    else:
        PARSER.set_defaults(log_level='WARN')

    args = PARSER.parse_args()
    logging.root.setLevel(getattr(logging, args.log_level))

    # Call the command.
    commands[args.command](args)


if __name__ == '__main__':
    main()
Beispiel #2
0
        settings = get_settings()
    except SettingsImportError, exc:
        print >> sys.stderr, exc.args[0]
        print >> sys.stderr
        print >> sys.stderr, "The original exception was:"
        print >> sys.stderr, '\t' + str(exc.args[1])
        sys.exit(1)

    from django.core import management as mgmt
    mgmt.setup_environ(settings)

    commands = find_all_commands(settings.INSTALLED_APPS)

    from djboss.parser import PARSER

    PARSER.set_defaults(settings=settings)
    if settings.DEBUG:
        PARSER.set_defaults(log_level='DEBUG')
    else:
        PARSER.set_defaults(log_level='WARN')

    args = PARSER.parse_args()
    logging.root.setLevel(getattr(logging, args.log_level))

    # Call the command.
    commands[args.command](args)


if __name__ == '__main__':
    main()
Beispiel #3
0
    try:
        settings = get_settings()
    except SettingsImportError, exc:
        print >> sys.stderr, exc.args[0]
        print >> sys.stderr
        print >> sys.stderr, "The original exception was:"
        print >> sys.stderr, '\t' + str(exc.args[1])
        sys.exit(1)

    import django
    django.setup()
    commands = find_all_commands(settings.INSTALLED_APPS)

    from djboss.parser import PARSER

    PARSER.set_defaults(settings=settings)
    if settings.DEBUG:
        PARSER.set_defaults(log_level='DEBUG')
    else:
        PARSER.set_defaults(log_level='WARN')

    args = PARSER.parse_args()
    logging.root.setLevel(getattr(logging, args.log_level))

    # Call the command.
    commands[args.command](args)


if __name__ == '__main__':
    main()
Beispiel #4
0
        settings = get_settings()
    except SettingsImportError, exc:
        print >> sys.stderr, exc.args[0]
        print >> sys.stderr
        print >> sys.stderr, "The original exception was:"
        print >> sys.stderr, '\t' + str(exc.args[1])
        sys.exit(1)

    from django.core import management as mgmt
    mgmt.setup_environ(settings)

    commands = find_all_commands(settings.INSTALLED_APPS)

    from djboss.parser import PARSER

    PARSER.set_defaults(settings=settings)
    if settings.DEBUG:
        PARSER.set_defaults(log_level='DEBUG')
    else:
        PARSER.set_defaults(log_level='WARN')

    args = PARSER.parse_args()
    logging.root.setLevel(getattr(logging, args.log_level))

    # Call the command.
    commands[args.command](args)


if __name__ == '__main__':
    main()