31 lines
689 B
Python
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
|
|
|