Example #1
0
from flask import Flask, url_for
import os
from flask_bootstrap import Bootstrap
import re
from time import strptime, strftime

from recipyCommon.config import get_db_path

recipyGui = Flask(__name__)
recipyGui.config["SECRET_KEY"] = "geheim"
recipyGui.config["tinydb"] = get_db_path()

Bootstrap(recipyGui)

# Function to easily find your assets
# In your template use <link rel=stylesheet href="{{ static('filename') }}">
recipyGui.jinja_env.globals["static"] = lambda filename: url_for("static", filename=filename)


def register_blueprints(app):
    # Prevents circular imports
    from recipyGui.views import routes

    recipyGui.register_blueprint(routes)


register_blueprints(recipyGui)

# Custom filters
@recipyGui.template_filter()
def highlight(text, query=None):
Example #2
0
from flask import Flask, url_for
import os
from flask_bootstrap import Bootstrap
import re
from time import strptime, strftime

recipyGui = Flask(__name__)
recipyGui.config["SECRET_KEY"] = "geheim"
recipyGui.config["tinydb"] = os.path.expanduser("~/.recipy/recipyDB.json")

Bootstrap(recipyGui)

# Function to easily find your assets
# In your template use <link rel=stylesheet href="{{ static('filename') }}">
recipyGui.jinja_env.globals["static"] = lambda filename: url_for("static", filename=filename)


def register_blueprints(app):
    # Prevents circular imports
    from recipyGui.views import routes

    recipyGui.register_blueprint(routes)


register_blueprints(recipyGui)

# Custom filters
@recipyGui.template_filter()
def highlight(text, query=None):
    """Filter to highlight query terms in search results."""
    if query: