https://github.com/cploutarchou/python_rest_api_with_mysql_and_flask
Python - Rest APIs tutorial using Flask & MySQL - phpMyAdmin
https://github.com/cploutarchou/python_rest_api_with_mysql_and_flask
api flask flask-sqlalchemy mysql python tutorial
Last synced: 12 months ago
JSON representation
Python - Rest APIs tutorial using Flask & MySQL - phpMyAdmin
- Host: GitHub
- URL: https://github.com/cploutarchou/python_rest_api_with_mysql_and_flask
- Owner: cploutarchou
- Created: 2021-05-14T18:24:12.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-17T17:01:41.000Z (almost 5 years ago)
- Last Synced: 2025-02-15T05:46:48.754Z (about 1 year ago)
- Topics: api, flask, flask-sqlalchemy, mysql, python, tutorial
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Work in Progress........................................
### **Python Rest CRUD API using Flask micro web framework**
We will build Rest Apis that can create, retrieve, update, delete and find Posts by title.
The following table shows overview of the Rest APIs that will be exported
| Methods | Urls | Actions |
|--|--|--|
| GET | api/posts/all | Get all Posts |
| GET | api/posts/:id| Get post by `id`|
| POST |api/posts/create| Create new post |
| PUT |api/posts/update/:id| Update post by `id` |
| DELETE |api/posts/delete/:id| Delete post by `id` |
| DELETE |api/posts/deleteall| Delete all posts| .
| GET |api/posts/published| Get all published posts|
| GET |api/posts?title=’test’| Get all posts which titlecontains `'test'`|
| GET |api/posts/publisher?name=’christos’| Get All posts where publisher name is `'christos'`|
Rename sample.evn to .env
**Sample .evn configuration**
__________________________________
* MYSQL_USER=user
* MYSQL_PASSWORD=pass
* MYSQL_DB=restapi
* MYSQL_HOST=127.0.0.1
* MYSQL_PORT=3306
* JWT_SECRET_KEY=Your secret key
* FLASK_APP = app.py
* FLASK_ENV = development
* FLASK_DEBUG = 1
You can download the postman collection with all API calls on the following [URL](https://www.getpostman.com/collections/cad81248502ec45e3e70).