Beispiel #1
0
 def get_application(self, global_options):
     from uliweb.manage import make_application
     
     return make_application(project_dir=global_options.project, start=False, 
         debug_console=False, debug=False, settings_file=global_options.settings, 
         local_settings_file=global_options.local_settings
         )
Beispiel #2
0
def get_app():
    from uliweb.manage import make_application
    app = make_application(start=False, debug_console=False, debug=False)
    return app
Beispiel #3
0
import sys, os

path = os.path.dirname(os.path.abspath(__file__))
project_path = path
sys.path.insert(0, project_path)
sys.path.insert(0, os.path.join(path, 'lib'))

from uliweb.manage import make_application
from werkzeug.serving import run_simple
application = make_application(project_dir=project_path)

run_simple('0.0.0.0',  int(os.environ.get('PORT', 5000)), application)
import sys, os

path = os.path.dirname(os.path.abspath(__file__))
if path not in sys.path:
    sys.path.insert(0, path)

from uliweb.manage import make_application
application = make_application(project_dir=path)
Beispiel #5
0
import sys, os

path = os.path.dirname(os.path.abspath(__file__))
if path not in sys.path:
    sys.path.insert(0, path)
apps_dir = os.path.join(path, 'apps')

from uliweb.manage import make_application
application = make_application(apps_dir=apps_dir)
Beispiel #6
0
def get_app(project_path='.', settings_file='settings.ini', local_settings_file='local_settings.ini'):
    from uliweb.manage import make_application
    
    app = make_application(project_dir=project_path, start=False)
    return app
Beispiel #7
0
def get_app(project_path='.'):
    from uliweb.manage import make_application
    
    app = make_application(apps_dir='apps', start=False)
    return app
Beispiel #8
0
import os, sys
import wsgiref.handlers
from uliweb.manage import make_application

path = os.path.dirname(__file__)
if path not in sys.path:
    sys.path.insert(0, path)

application = make_application(False, project_dir=path, debug_console=False)
wsgiref.handlers.CGIHandler().run(application)
Beispiel #9
0
def get_app(project_path='.', settings_file='settings.ini', local_settings_file='local_settings.ini'):
    from uliweb.manage import make_application
    
    app = make_application(project_dir=project_path, start=False)
    return app
Beispiel #10
0
def main():
    #/ PYTHONPATH bootstrap
    my_pp_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    ## |pp| means PYTHONPATH

    if my_pp_dir not in sys.path:
        sys.path.insert(0, my_pp_dir)

    #/
    import aoikuliwebstart.urlstohdlrs as urlstohdlrs

    #/
    parser = ArgumentParser(add_help=False)

    parser.add_argument(
        '-o', '--host',
        default='127.0.0.1',
    )

    parser.add_argument(
        '-p', '--port',
        type=int,
        default=8000,
    )

    parser.add_argument(
        '-w', '--wsgi',
        dest='wsgi_on',
        action='store_true',
    )

    args_obj, _ = parser.parse_known_args()

    #/
    urlstohdlrs.init()

    #/
    wsgi_on = args_obj.wsgi_on

    if wsgi_on:
        #/
        host = args_obj.host

        port = args_obj.port

        #/
        proj_dir = os.path.dirname(os.path.abspath(__file__))

        wsgi_app = make_application(project_dir=proj_dir)

        #/
        print('HTTP is on: {}:{}'.format(host, port))

        srvr = make_server(host, port, wsgi_app)

        srvr.serve_forever()
    else:
        #/
        from pkg_resources import load_entry_point

        ep = load_entry_point('Uliweb', 'console_scripts', 'uliweb')

        ep()
import os, sys
import wsgiref.handlers
from uliweb.manage import make_application

path = os.path.dirname(__file__)
if path not in sys.path:
    sys.path.insert(0, path)
apps_dir = os.path.join(path, 'apps')

application = make_application(False, apps_dir, debug_console=False)
wsgiref.handlers.CGIHandler().run(application)