button to generate html delete method?
I'm creating a little web app in flask using django and jinja2. I have a
python script running on some servers that generate html post requests,
which then update a mongodb with some info. These then show up on a
dashboard. Easy, i have that working. However, i would like to include a
button on the dashboard to remove them once i've addressed the issue for
that server
in python i know I use
from flask import request
requests.post('http://<myserver>/api", data=some_event_data)
To remove the server I know in python i can use
from flask import request
requests.delete('http://<myserver>:5000/api", data=server_name)
to remove the server and drop it from the database.
...can i have an HTML button do the same thing? I've tried a number of
different things but the button always wants to submit and open
http://:5000/api but that's just an interface listening for data either
with a post or delete method.
Any help would be great
Friday, August 16, 2013
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment