Simple API With Python
API with python ,Flask, MYSQL, html. Simple API and web interface for managing a single word in the database
Flask application that connects to a MySQL database and provides a simple API and web interface for managing a single word in the database
Flask for creating the application, jsonify for creating JSON responses, render_template for rendering HTML templates, request for accessing request data, and pymysql for connecting to the MySQL database.
We want to give mysql connection parameters.
An API endpoint ("/api/word") that returns the word as a JSON response which is saved in database.
A route for the admin page ("/admin") that renders the "admin.html" template.
A route ("/admin/update") that handles a POST request for updating the word in the database. It retrieves the new word from the form data, updates the "word" table in the database, and returns a success message.
This is simple API with Python ,flask,mysql.It will display the word present in database.We can update word in database.After update we get message word updated sucessfully.
Project Files
| .. | ||
| This directory is empty. | ||