Beispiel #1
0
    def runserver(self, host, port, noreload):
        """Runs the development server for the current application.

        Args:
            host: The host to bind to
            port: The port to run on
        """
        app_dir = os.environ['APP_DIR']
        app_module = os.environ['APP_MODULE']
        script_dir = os.environ['SCRIPT_DIR']
        public_dir = os.environ['PUBLIC_DIR']
        os.chdir(app_dir)
        app = load_definition_from_string('{0}.app.application'.format(
            app_module))
        kwargs = {
            'app': app,
            'script_dir': script_dir,
            'public_dir': public_dir,
        }
        if host:
            kwargs['host'] = host
        if port:
            kwargs['port'] = int(port)
        kwargs['noreload'] = True if noreload else False

        make_dev_server(**kwargs)
Beispiel #2
0
 def execute(self):
     app_dir = os.environ['APP_DIR']
     app_module = os.environ['APP_MODULE']
     script_dir = os.environ['SCRIPT_DIR']
     public_dir = os.environ['PUBLIC_DIR']
     os.chdir(app_dir)
     app = load_definition_from_string('{0}.app.application'.format(
         app_module))
     make_dev_server(app,
                     do_reload=True,
                     script_dir=script_dir,
                     public_dir=public_dir)
Beispiel #3
0
 def execute(self):
     app_dir = os.environ['APP_DIR']
     app_module = os.environ['APP_MODULE']
     script_dir = os.environ['SCRIPT_DIR']
     public_dir = os.environ['PUBLIC_DIR']
     os.chdir(app_dir)
     app = load_definition_from_string('{0}.app.application'.format(
         app_module))
     kwargs = {
         'app': app,
         'script_dir': script_dir,
         'public_dir': public_dir,
     }
     if self.parsed_args.host:
         kwargs['host'] = self.parsed_args.host
     if self.parsed_args.port:
         kwargs['port'] = int(self.parsed_args.port)
     make_dev_server(**kwargs)
Beispiel #4
0
 def execute(self):
     app_dir = os.environ['APP_DIR']
     app_module = os.environ['APP_MODULE']
     script_dir = os.environ['SCRIPT_DIR']
     public_dir = os.environ['PUBLIC_DIR']
     os.chdir(app_dir)
     app = load_definition_from_string(
         '{0}.app.application'.format(app_module))
     kwargs = {
         'app': app,
         'script_dir': script_dir,
         'public_dir': public_dir,
     }
     if self.parsed_args.host:
         kwargs['host'] = self.parsed_args.host
     if self.parsed_args.port:
         kwargs['port'] = int(self.parsed_args.port)
     make_dev_server(**kwargs)