Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshidivanshu/blog-backend-using-fastapi-jwt-authentication
A Blog app backend created using FastAPI. Can perform test queries on the provided link just replace http://localhost:8000/ with a website link mentioned below. You can perform this using Postman or curl
https://github.com/joshidivanshu/blog-backend-using-fastapi-jwt-authentication
alembic api asychronous backend fastapi jose-jwt jwt-authentication oauth2 python-3 sqlaclhemy sqlite3 webdevelopment
Last synced: about 12 hours ago
JSON representation
A Blog app backend created using FastAPI. Can perform test queries on the provided link just replace http://localhost:8000/ with a website link mentioned below. You can perform this using Postman or curl
- Host: GitHub
- URL: https://github.com/joshidivanshu/blog-backend-using-fastapi-jwt-authentication
- Owner: joshidivanshu
- Created: 2021-05-20T13:12:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-20T13:18:12.000Z (over 3 years ago)
- Last Synced: 2023-12-13T05:36:59.523Z (11 months ago)
- Topics: alembic, api, asychronous, backend, fastapi, jose-jwt, jwt-authentication, oauth2, python-3, sqlaclhemy, sqlite3, webdevelopment
- Language: Python
- Homepage: https://ohogkv.deta.dev/
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blog FastAPI & Jwt Authentication
An api for Blog using FastAPI## Installing Requirements
Use Virtualenv and install the packages.
```
pip install -r requirements.txt
```
## Running the ProjectGo to the project dir and run the below line in the terminal.
```
uvicorn main:app --reload
```## Interacting with the API
1. To get all blogs
```
[GET]
http://localhost:800/blog
Authorization : Bearer token
```
2. to get a blog with id
```
[GET]
http://localhost:8000/blog/{blog_id}
Authorization : Bearer token
```
3. To create a blog
```
[POST]
http://localhost:8000/blog
in request body pass in json
{
"title": "title of the blog",
"body": "body of the blog"
}
Authorization : Bearer token
```
4. To delete a blog
```
[DELETE]
http://localhost:8000/blog/{blog_id}
Authorization : Bearer token
```
5. To update a blog
```
[PUT]
http://localhost:8000/blog/{blog_id}
in request body pass in json
{
"title": "title of the blog",
"body": "body of the blog"
}
Authorization : Bearer token
```
6. To retrieve access token
```
[POST]
http://localhost:8000/login
in form passs
username & password
```
7. To create a user
```
[POST]
http://localhost:8000/user
Authorization : Bearer token
```### Default Username & Password
```
username = divanshu
password = divanshu
```