You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
904 B
26 lines
904 B
from flask import Flask
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
from flask_migrate import Migrate
|
|
|
|
db = SQLAlchemy()
|
|
|
|
def create_app():
|
|
app = Flask(__name__, template_folder='templates', static_folder='static', static_url_path='/')
|
|
#app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///./test.db'
|
|
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://minibase_user:minibase_user1234@postgres_db.keydev.me:5432/minibase'
|
|
app.secret_key = 'SOME KEY'
|
|
db.init_app(app)
|
|
|
|
# import and register all blueprints.
|
|
from blueprintapp.blueprints.todos.routes import todos
|
|
from blueprintapp.blueprints.people.routes import people
|
|
from blueprintapp.blueprints.core.routes import core
|
|
|
|
app.register_blueprint(todos, url_prefix='/todos')
|
|
app.register_blueprint(people, url_prefix='/people')
|
|
app.register_blueprint(core, url_prefix='/')
|
|
Migrate(app, db)
|
|
|
|
return app
|
|
|