Template for a CRUD (Create, Read, Update, and Delete) using Flask (Python) and Microsoft SQL Server
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
This template is a CRUD (Create, Read, Update. and Delete) built with Flask and Microsoft SQL Server. This contains only a User Table:
User |
---|
id_card: INT |
id_user: INT |
[name]: VARCHAR(30) |
last_name: VARCHAR(30) |
phone_number: INT |
email: VARCHAR(100) |
- Python 3.12.
- SQL Server 2022.
- Microsoft SQL Management Studio 20.
-
Clone the repo
git clone https://github.com/ErickOf/CRUD-Flask-SQLServer.git
-
Install Python packages
pip install -r requirements.txt
-
Create a DB in Microsoft SQL Management Studio.
-
Update JSON file in
API/config/development.json
with DB configuration:
{
"user": "<db-user>",
"password": "<db-password>",
"host": "localhost",
"port": 3306,
"database": "<db-name>"
}
There are stored procedures for each CRUD operation:
- Create:
createNewUser
- Read:
getUsers
andgetUserByID
- Update:
updateUser
- Delete:
deleteUser
and they are called from API:
- Create:
<hostname>:<port>/users/create
(POST Method)
- Read:
<hostname>:<port>/users/<_id>
(GET Method)<hostname>:<port>/users
(GET Method)
- Delete:
<hostname>:<port>/users/<_id>
(DELETE Method)
- Update:
<hostname>:<port>/users/<_id>
(PUT Method)
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your feature branch (
git checkout -b feature-<feature-name>
) - Commit your changes (
git commit -m 'Add some <feautre>'
) - Push to the branch (
git push origin feature-<feature-name>
) - Open a pull request
Distributed under the MIT License. See LICENSE.txt
for more information.
Erick Andrés Obregón Fonseca - erickobregonf@gmail.com
Project Link: https://github.com/ErickOF/CRUD-Flask-SQLServer