Files
DataLogger-Generic/web_db/flask/app/__init__.py
2016-10-26 17:45:25 -05:00

31 lines
689 B
Python

# project/__init__.py
from flask import Flask, render_template, request, session, send_from_directory
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask('app', static_url_path='')
app.config.update(
DEBUG=True,
SQLALCHEMY_DATABASE_URI='sqlite:///../database.db',
)
db = SQLAlchemy(app)
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def catch_all(path):
return app.send_static_file('index.html')
@app.route("/ng/<path:path>")
def send_ng(path):
return send_from_directory('static/ng', path)
@app.route("/css/<path:path>")
def send_css(path):
return send_from_directory('static/css', path)
from datalogger import datalogger