Python हिंदी | CRUD Opration with mysql , html , Bootstrap in Python ng ( Hindi )

Pubblicato il: 31 ottobre 2023
sul canale di: RNG Developer
23
2

This Flask application allows users to create and submit blog entries through a web form. The application is connected to a MySQL database to store the blog data. Here's a summary of the code:

It imports the necessary modules, including mysql.connector for MySQL database interaction and Flask for web application development.

A MySQL database connection is established using the provided database credentials (host, user, password, and database name).

A cursor object is created to execute SQL queries.

A route (/create) is defined to handle both GET and POST requests. When a GET request is made, it renders an HTML form for users to input blog data. When a POST request is made (form submission), it extracts the title and content from the form data, inserts the data into the blog table in the database, and redirects the user back to the form for further submissions.

An HTML template (create.html) is provided to render the form, which includes fields for the blog's title and content.

The Flask application is run in debug mode (debug=True) when the script is executed.

Overall, this code creates a basic Flask web application that allows users to create and store blog entries in a MySQL database. Users can access the form to submit new blog entries, which are then stored in the database for later retrieval and display.

Download the code https://github.com/rohitrng/python_cr...


In questa pagina del sito puoi guardare il video online Python हिंदी | CRUD Opration with mysql , html , Bootstrap in Python ng ( Hindi ) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato RNG Developer 31 ottobre 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 23 volte e gli è piaciuto 2 spettatori. Buona visione!