Example #1
0
)
from flask.ext.assets import Environment
from flask.json import JSONEncoder

from beancount_web.api import FilterException

app = Flask(__name__)
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
# the key is currently only required to flash messages
app.secret_key = "1234"

assets = Environment()
app.config["ASSETS_CACHE"] = False
app.config["ASSETS_DEBUG"] = False
app.config["ASSETS_MANIFEST"] = None
assets.init_app(app)


@app.route("/account/<name>/")
def account_with_journal(name=None):
    return account(account_name=name, with_journal=True)


@app.route("/account/<name>/monthly_balances/")
def account_with_monthly_balances(name=None):
    return account(account_name=name, with_monthly_balances=True)


@app.route("/account/<name>/yearly_balances/")
def account_with_yearly_balances(name=None):
from flask import Flask, render_template
from flask.ext.assets import Environment, Bundle, ExternalAssets

app = Flask(__name__)
app.debug = True
app.config["ASSETS_DEBUG"] = False
app.config["ASSETS_URL"] = "//0.0.0.0:5001/static/"
app.config["ASSETS_MANIFEST"] = "file"

assets = Environment(app)

css = Bundle("css/main.css", "css/sub/sub-main.css", filters="cssrewrite", output="gencss/css-merged.%(version)s.css")

external_main = ExternalAssets("css/img/*", "img/*", output="genimg/")

external_sub = ExternalAssets("css/sub/img/*", output="genimg/")

assets.register("external_main", external_main)
assets.register("external_sub", external_sub)
assets.register("css", css)

# print app.config


@app.route("/")
def index():
    return render_template("index.jinja")


if __name__ == "__main__":
    app.run(host="0.0.0.0", port=5001)