From 939bcba185b9969999078388b82e613e17cad843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Ates?= Date: Tue, 23 Jun 2015 16:24:53 +0200 Subject: [PATCH] Add control file. --- biomon-ctl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 biomon-ctl diff --git a/biomon-ctl b/biomon-ctl new file mode 100755 index 0000000..a2c70f9 --- /dev/null +++ b/biomon-ctl @@ -0,0 +1,20 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + config_file = False + + argv = sys.argv[1:] + if argv and argv[0].startswith('--config='): + config_file = argv[0].split('=')[1] + argv.pop(0) + + if config_file: + os.environ['BIOMON_SETTINGS_FILE'] = config_file + + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "biomon.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv[:1] + argv)