Ask coding questions

← Back to all posts
[PYTHON] How do I change the replit database with an HTML button?
MrVoo

I'm making a flask thing and I'm trying to increase a value in the replit database by 1. Anyone know how to change the database by pressing a button on the page?

Answered by CosmicBear [earned 5 cycles]
View Answer
Voters
rickysong
MrVoo
Comments
hotnewtop
CosmicBear

or,

VulcanWM

Make a app route in which you do the increase function and make the button redirect to that route

MrVoo

@VulcanWM What would that look like? I'm pretty bad at flask

VulcanWM

Do the /change route in this repl: https://replit.com/@VulcanWM/casino#app.py for the Python part
For the html, make a link for the route /change and style it as a button @MrVoo