예제 #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
파일: base.py 프로젝트: huiyineo/myproject
 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)