Beispiel #1
0
    def handle(self, _, site, host, port, use_debugger, use_reloader):
        site = validate_site(site)
        app = Tango.get_app(site)

        if not app: return
        app.run(host=host, port=port, debug=use_debugger,
                use_debugger=use_debugger, use_reloader=use_reloader,
                **self.server_options)
Beispiel #2
0
    def handle(self, _, site, *args, **kwargs):
        with no_pyc():
            site = validate_site(site)
            app = Tango.get_app(site)

            if not app: return

            Command.handle(self, app, *args, **kwargs)
 def test_indexerror_app(self):
     # Must load single-module apps without import.
     # Test passes if Tango.get_app('indexerror') did not error out.
     Tango.get_app('indexerror')
Beispiel #4
0
def get_app(site, module=None):
    try:
        return Tango.get_app(module or site)
    except ModuleNotFound:
        print "Cannot locate site: '{0}'.".format(site)