Den 23/01/2014 kl. 15.06 skrev Johannes Schneider <
johannes....@galileo-press.de>:
> Hi List,
> see the question in the subject. I want to return from a management command with a given exit code. How can this be done?
class Command(BaseCommand):
def handle(self, *args, **options):
try:
# Something that may fail
except TheException:
# Clean up any transactions, open database connections etc.
import sys
sys.exit(123)
Erik