Category : flask

Okay so I have been surfing the internet about this for a while, I need to make an upvote and downvote system in my flaskwebapp, but everywhere it’s made mostly using PHP and MySQL, how do I redirect or render a PHP template so that it works with my flask app? Every tutorial in the ..

Read more

I would like to create a web server that has a console to control the server. It’s kind of like webmin although I would like it to run different commands (ie. qemu). I have tried using Flask and returning subprocess, although I’m fine with using PHP or HTML. Code: from flask import Flask, escape, request, ..

Read more

I am making simple app which can display names from database in flask webapp. I already created, ajax script: function loadnames() { $.ajax({ url: "/", type: "POST", cache: false, success: function(data) { $("#names").html(data); } }); } here is div to display names: <div class="content"> <ul id="names"> </ul> </div> here is flask app: @app.route(‘/’, methods=[‘GET’]) def ..

Read more

app.py @app.route(‘/register’,methods=[‘GET’,’POST’]) def register(): if request.method == ‘POST’: details = request.form name = details[‘name’] username = details[‘username’] password = details[‘password’] tel = details[‘tel’] email = details[’email’] is_member = details[‘member’] if is_member == ‘on’: is_member = True else: is_member = False cursor = mysql.connection.cursor() query = ”’INSERT INTO customers (name,username,password,tel,email,member) VALUES(%s,%s,%s,%s,%s,%s)”’ values = (name,username,password,tel,email,is_member) cursor.execute(query,values) mysql.connection.commit() ..

Read more