Compare commits

..

4 Commits

Author SHA1 Message Date
Alex
f166b1c3bc access 2024-07-25 13:06:11 +00:00
Alex
f9c4f68915 config pour utilisation du script dans flask 2024-07-25 12:59:42 +00:00
Alex
84b08f0d34 Merge branch 'main' of https://git.alex-design.fr/Alex/python.tag_dans_JPG_et_PDF into main 2024-07-25 12:50:14 +00:00
Alex
a0bd30c8d6 modificaiton pour flask 2024-07-25 12:49:36 +00:00

10
app.py
View File

@ -1,7 +1,7 @@
from flask import Flask, render_template, request, redirect, url_for, jsonify, flash
from flask_login import LoginManager, UserMixin, login_user, login_required, logout_user, current_user
import json
from main import main, load_config
from main import main, traitement
app = Flask(__name__)
app.secret_key = 'your_secret_alex-design_key-2024'
@ -11,7 +11,7 @@ login_manager.init_app(app)
login_manager.login_view = 'login'
# Utilisateurs fictifs pour l'exemple
users = {'admin': {'password': 'password'}}
users = {'AlexDesign': {'password': 'gb7b1-S7ECGxlcZMi5cnT'}}
class User(UserMixin):
def __init__(self, username):
@ -49,9 +49,9 @@ def index():
@login_required
def run():
filigramme = request.form['filigramme']
config = load_config()
result = my_function({}, filigramme)
result = traitement(filigramme) # on passe l'argument a la function 'main' du programme
return jsonify(result)
if __name__ == '__main__':
app.run(debug=True)
app.run(host='0.0.0.0', port=5000, debug=True)