Update: Only issues with DB
This commit is contained in:
parent
22664e3f46
commit
323f36e7dc
5 changed files with 9 additions and 26 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ class Config(object):
|
|||
TESTING = False
|
||||
CSRF_ENABLED = True
|
||||
|
||||
PORT = int(os.environ.get('PORT', 33507))
|
||||
SECRET_KEY = os.environ.get('SECRET_KEY', None)
|
||||
FLASK_APP = os.environ.get('FLASK_APP', None)
|
||||
FLASK_ENV = os.environ.get('FLASK_ENV', None)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export FLASK_APP=run.py
|
||||
export FLASK_APP=app.py
|
||||
export FLASK_ENV=development
|
||||
export FLASK_DEBUG=1
|
||||
export PYTHONUNBUFFERED=1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue