示例#1
0
def serve(env):
    """serve stuff... prod is mostly done by just doing `python fragile.py`"""
    app = make_app(env)

    port = {
        "prod": 5000,
        "dev": 5001,
        "test": 5002,
        "build": 5003,
    }[env]

    app.run(port=port)
示例#2
0
def serve(env):
    """serve stuff... prod is mostly done by just doing `python fragile.py`"""
    app = make_app(env)

    port = {
        "prod": 5000,
        "dev": 5001,
        "test": 5002,
        "build": 5003,
    }[env]

    app.run(port=port)
示例#3
0
def html():
    """use the `build` app style to generate the hosted static html"""
    proj()
    print ". generating production html"

    app = make_app("build")

    prod_files = {
        "dist/index.html": "/dist/",
    }

    for prod_file, url in prod_files.items():
        print ".. writing ", prod_file
        open(prod_file, "w").write(app.test_client().get(url).data.replace(
            'src="/lib/',
            'src="./').replace('src="/',
                               'src="./').replace('href="/', 'href="./'))
示例#4
0
def html():
    """use the `build` app style to generate the hosted static html"""
    proj()
    print ". generating production html"

    app = make_app("build")

    prod_files = {
        "dist/index.html": "/dist/",
    }

    for prod_file, url in prod_files.items():
        print ".. writing ", prod_file
        open(prod_file, "w").write(
            app.test_client().get(url).data
            .replace('src="/lib/', 'src="./')
            .replace('src="/', 'src="./')
            .replace('href="/', 'href="./')
        )
示例#5
0
"""
Deployment-specific stub for hosting under Passenger WSGI

Should this live in another branch?   
"""
import os
import sys

# Passenger stuff
INTERP = os.path.join(os.environ["HOME"], "fragl_env", "bin", "python")

if sys.executable != INTERP:
    os.execl(INTERP, INTERP, *sys.argv)

# add to proper path
sys.path.extend([
  os.getcwd(),
  os.path.join(os.getcwd(), "app")
])

try:
    import local_config
    local_config.setup()
except ImportError:
    pass

# primary import
from fragile import make_app

application = make_app("prod")
示例#6
0
"""
Deployment-specific stub for hosting under Passenger WSGI

Should this live in another branch?   
"""
import os
import sys

# Passenger stuff
INTERP = os.path.join(os.environ["HOME"], "fragl_env", "bin", "python")

if sys.executable != INTERP:
    os.execl(INTERP, INTERP, *sys.argv)

# add to proper path
sys.path.extend([os.getcwd(), os.path.join(os.getcwd(), "app")])

try:
    import local_config
    local_config.setup()
except ImportError:
    pass

# primary import
from fragile import make_app

application = make_app("prod")