accountant/app.py

37 lines
1.2 KiB
Python
Raw Normal View History

2013-02-08 13:07:27 +01:00
"""
This file is part of Accountant.
Accountant is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Foobar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
"""
2013-12-03 22:39:01 +01:00
from api import api
from api.model import db
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
2013-12-03 22:22:25 +01:00
from frontend import frontend
2013-12-03 22:39:01 +01:00
from sqlalchemy.orm import sessionmaker
2013-11-10 20:20:01 +01:00
import config
2013-01-24 01:59:42 +01:00
# The app
2013-12-03 22:22:25 +01:00
app = Flask(__name__, static_folder = None)
2013-11-10 20:20:01 +01:00
app.config['SQLALCHEMY_DATABASE_URI'] = config.db_uri
app.config['SQLALCHEMY_RECORD_QUERIES'] = config.debug
2013-12-03 22:22:25 +01:00
db.init_app(app)
app.register_blueprint(frontend, url_prefix='')
app.register_blueprint(api, url_prefix='/api')