示例#1
0
 def handle_default_options(self, argv):
     acc = []
     broker = None
     for i, arg in enumerate(argv):
         # --settings and --pythonpath are also handled
         # by BaseCommand.handle_default_options, but that is
         # called with the resulting options parsed by optparse.
         if '--settings=' in arg:
             _, settings_module = arg.split('=')
             setenv('DJANGO_SETTINGS_MODULE', settings_module)
         elif '--pythonpath=' in arg:
             _, pythonpath = arg.split('=')
             sys.path.insert(0, pythonpath)
         elif '--broker=' in arg:
             _, broker = arg.split('=')
         elif arg == '-b':
             broker = argv[i + 1]
         else:
             acc.append(arg)
     if broker:
         self.set_broker(broker)
     return argv if self.keep_base_opts else acc
 def handle_default_options(self, argv):
     acc = []
     broker = None
     for i, arg in enumerate(argv):
         # --settings and --pythonpath are also handled
         # by BaseCommand.handle_default_options, but that is
         # called with the resulting options parsed by optparse.
         if '--settings=' in arg:
             _, settings_module = arg.split('=')
             setenv('DJANGO_SETTINGS_MODULE', settings_module)
         elif '--pythonpath=' in arg:
             _, pythonpath = arg.split('=')
             sys.path.insert(0, pythonpath)
         elif '--broker=' in arg:
             _, broker = arg.split('=')
         elif arg == '-b':
             broker = argv[i + 1]
         else:
             acc.append(arg)
     if broker:
         self.set_broker(broker)
     return argv if self.keep_base_opts else acc
 def set_broker(self, broker):
     setenv('CELERY_BROKER_URL', broker)
示例#4
0
 def set_broker(self, broker):
     setenv('CELERY_BROKER_URL', broker)
示例#5
0
def main(argv=sys.argv):
    from django.core import management
    setenv('CELERY_LOADER', 'default')
    configure()
    management.call_command('migrate')
    run_monitor(argv)
示例#6
0
 def set_broker(self, broker):
     setenv("CELERY_BROKER_URL", broker)
示例#7
0
文件: mon.py 项目: aczapata/twitter
def main(argv=sys.argv):
    from django.core import management
    setenv('CELERY_LOADER', 'default')
    configure()
    management.call_command('syncdb')
    run_monitor(argv)