Update: Only issues with DB

This commit is contained in:
Yûki VACHOT 2021-12-08 14:39:45 +01:00
parent 22664e3f46
commit 323f36e7dc
5 changed files with 9 additions and 26 deletions

View file

@ -9,7 +9,7 @@ patch_all()
def create_app():
app = Flask(__name__)
app = Flask(__name__, instance_relative_config=False)
FLASK_ENV = os.environ.get('FLASK_ENV', None)
if FLASK_ENV == 'production':
app.config.from_object("config.ProductionConfig")
@ -26,10 +26,9 @@ def create_app():
else:
print('ENV Variables passed : ', app.config['SQLALCHEMY_BINDS'])
# import routes
return app
# db.init_app(app)
# db.create_all()
with app.app_context():
from . import routes
# db.create_all()
# return app
return app

View file

@ -1,14 +0,0 @@
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from flask import current_app as app
from backend import db
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run()

View file

@ -1,11 +1,10 @@
# from application import app
# from ..run import app
from flask import current_app as app
from flask import request
from .users_model import Users, db
from responses import send_message, send_error
from .responses import send_message, send_error
# Login
@app.route('/api/login', methods=['POST'])
def login():
return send_message('Login not implemented', None)