Это мой код < /p> [code]import os from flask import Flask, render_template, redirect, url_for, request, jsonify from flask_login import LoginManager, UserMixin, login_user, current_user from flask_sqlalchemy import SQLAlchemy
if request.method == "POST": if not db.session.query(Users).filter_by(username=request.form.get("uname")).count() < 1: return render_template("sign_up.html", value = "USER ALREADY EXISTS") if request.form.get("uname") == "": return render_template("sign_up.html", value = "USERNAME IS BLANK") if request.form.get("psw") == "": return render_template("sign_up.html", value = "PASSWORD IS BLANK") if request.form.get("loc") == "": return render_template("sign_up.html", value = "LOCATION IS BLANK") user = Users(username=request.form.get("uname"), password=request.form.get("psw"), location=request.form.get("loc"), aw="0", ms="0", sa="0")
if request.method == "POST": user = Users.query.filter_by( username=request.form.get("uname")).first() if not user: return render_template("login.html", value = request.form.get("uname"))
if user.password == request.form.get("psw"): login_user(user) return redirect(url_for("index", username = user.username, aw = user.aw, ms = user.ms, sa = user.sa)) return render_template("login.html")
if __name__ == "__main__": app.run(host ="0.0.0.0", port = 10000, debug=False)
< /code> Я не получил никаких ошибок вообще, но в коде есть два оператора печати, и ни один из них не выполняется в консоли < /p> Однако в консоли < /p> 127.0.0.1 - - [28/Apr/2025 18:10:43] "POST /index HTTP/1.1" 200 - 127.0.0.1 - - [28/Apr/2025 18:10:43] "POST /index HTTP/1.1" 200 - 127.0.0.1 - - [28/Apr/2025 18:10:43] "POST /index HTTP/1.1" 200 - 127.0.0.1 - - [28/Apr/2025 18:10:43] "POST /index HTTP/1.1" 200 - 127.0.0.1 - - [28/Apr/2025 18:10:43] "POST /index HTTP/1.1" 200 - 127.0.0.1 - - [28/Apr/2025 18:10:43] "POST /index HTTP/1.1" 200 - 127.0.0.1 - - [28/Apr/2025 18:10:44] "POST /index HTTP/1.1" 200 - 127.0.0.1 - - [28/Apr/2025 18:10:44] "POST /index HTTP/1.1" 200 - 127.0.0.1 - - [28/Apr/2025 18:10:44] "POST /index HTTP/1.1" 200 - 127.0.0.1 - - [28/Apr/2025 18:10:44] "POST /index HTTP/1.1" 200 - < /code> Это продолжает повторять im вызовать метод с помощью JavaScript, подобного этому < /p> fetch('/index', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) }) requestAnimationFrame(check) } setTimeout(() => { requestAnimationFrame(check) }, 500) [/code] может кто -нибудь, пожалуйста, помогите, я довольно новичок в колбе, и простите меня, если это простая проблема