Implemented upload

This commit is contained in:
2020-04-14 17:03:15 +02:00
parent 7fcc4bfa37
commit 8a82bf07c5
6 changed files with 110 additions and 11 deletions

View File

@@ -8,7 +8,7 @@ from werkzeug.middleware.proxy_fix import ProxyFix
# import stuff
from model import db
from utils import register_all_error_handlers
from utils import register_all_error_handlers, storage
# import views
from views import ModelView
@@ -33,7 +33,9 @@ app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URI', "sqlite:/
app.config['MINIO_ENDPOINT'] = os.environ['MINIO_ENDPOINT']
app.config['MINIO_ACCESS_KEY'] = os.environ['MINIO_ACCESS_KEY']
app.config['MINIO_SECRET_KEY'] = os.environ['MINIO_SECRET_KEY']
app.config['MINIO_BUCKET_NAME'] = os.environ['MINIO_BUCKET_NAME']
app.config['MINIO_MODEL_BUCKET_NAME'] = os.environ['MINIO_MODEL_BUCKET_NAME']
app.config['MINIO_MEANS_BUCKET_NAME'] = os.environ['MINIO_MEANS_BUCKET_NAME']
# important stuff
app.secret_key = os.environ.get('SECRET_KEY', os.urandom(12))
@@ -42,6 +44,7 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
# initialize stuff
db.init_app(app)
storage.init_app(app)
with app.app_context():
db.create_all()