def ekle(id): if id is not None: databse = Db() sql = """ select * from "BlogYazisi" where "Id" = %s """ data = databse.read_first_data(sql, (id, )) print(data) return render_template("admin/blog/ekle.html", data=data) return render_template("admin/blog/ekle.html", data=None)
def login(): email = request.form.get("email") sifre = request.form.get("sifre") sifre_hash = hashlib.md5(sifre.encode()).hexdigest() databse = Db() sql = """ select * from "User" where "Email"=%s and "Password"=%s """ find = databse.read_first_data(sql, (email, sifre_hash)) # find = databse.read_first_data(sql, (email, sifre_hash)) if find is None: return render_template("admin/giris/index.html", hata=True) print(find) session["FullName"] = find[3] session["isLogin"] = True session["Image"] = find[4] return redirect("/admin/uye/index")