from flask import ( Blueprint, flash, g, redirect, render_template, request, session, url_for ) from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from auth import login_required from config import CONFIG from create_db import User, Card import nextcloud_client bp = Blueprint('upload', __name__, url_prefix='/upload') engine = create_engine(CONFIG['DB_CONNECTION']) dbsessionmaker = sessionmaker(bind=engine) dbsession = dbsessionmaker() @bp.route("/", methods=("GET", "POST")) def index(): return render_template("menu/upload.html") @bp.route('/uploader', methods = ['GET', 'POST']) def upload_file(): print("heyy") if request.method == 'POST': #flask gets the file upload = request.files["file"] print("hello") #upload to nc #get public link #update db #predpostavlja title, ir, owner_id, item_location #card = Card(title=name, interest_rate=-1.0, owner_id=1, item_location=public_link) #dbsession.add(card) #dbsession.commit()