Code Monkey home page Code Monkey logo

crud-operations-with-python-and-mysql's Introduction

Crud-Operations-with-Python-and-Mysql

This is a basic example for Flask-python and Mysql. Basically this repository contains the run.py which will contains the all the crud operation functions and it will throws the HTML files based on the events. #Requirements

1.python 2.7.11
a. Download python from python.org.
b.tar -xzf Python-2.7.11.tgz
c. cd Python-2.7.11
d. use the following commands "./configure"
e. After successfull configure use "make"
f. After successfull make use "sudo make install"
2. flask
a. sudo apt-get install virtualenv
b. sudo pip install virtualenv(sudo apt-get install python-virtualenv)
c. sudo pip install flask
3. mysql Database(sudo apt-get install mysql-server)
4. pymysql(sudo pip install pymysql)

The CRUD operations are performed with Flask and mysql with simple Sql queries. It contains the INSERT,DELETE,UPDATE,SELECT operations in simple Flask Program.

The all HTML files are present in the "Templates" Directory.

when ever user opens the Browser and enters "localhost:5000" then the main function will execute and it throw "index.html" page which will contains main links. alt tag

The first operation is "Insert". By clicking the insert then the "createForm" function will execute and will throw "insert.html" which contains name,latitude,longitude textfields.

alt tag
After that "insert" function will be executed and the form values are loaded to python script and the values are stored in mysql database. If it was success the it will dispay the name for the user as shown below. alt tag

If you click the "showdetails" link then "select" function will be executed and will throw a "show.html" for which will contains the values retrived from database. alt tag

The user can update the values in the table based on ID by clicking the "update" in index.html. By clicking update "update" function will be executed and it will throw a html form which will take ID as input.

alt tag After entering ID and submiting it goto "update_details" form and it will throw HTML page with textfileds and data from the database as shown below image. alt tag After successfull update it will display the nameof the user who updated the details as shown below. alt tag

The user can delete the details based on ID just like update. As shown beow alt tag alt tag

The showJson will display data in the form of JSON. If anyone want insert the into some other Database it will be very helpfull. alt tag

                                            Thank You

crud-operations-with-python-and-mysql's People

Contributors

satyapendem avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.