21 lines
406 B
Python
21 lines
406 B
Python
from flask import Flask
|
|
|
|
from . import dm, dmcal
|
|
|
|
|
|
def create_app():
|
|
app = Flask("deskmeter")
|
|
|
|
app.debug = True
|
|
app.register_blueprint(dm.dmbp)
|
|
|
|
# Register custom Jinja2 filters
|
|
@app.template_filter('hash')
|
|
def hash_filter(s):
|
|
"""Return hash of string for consistent color generation"""
|
|
if s is None:
|
|
return 0
|
|
return hash(str(s))
|
|
|
|
return app
|