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

Veröffentlicht am: 31 Oktober 2023
auf dem Kanal: 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...


Auf dieser Seite können Sie das Online-Video Python हिंदी | CRUD Opration with mysql , html , Bootstrap in Python ng ( Hindi ) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer RNG Developer 31 Oktober 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 23 Mal angesehen und es wurde von 2 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!