Skip to content

Commit 0778ebd

Browse files
docs: update readme
1 parent b9f283c commit 0778ebd

File tree

3 files changed

+31
-15
lines changed

3 files changed

+31
-15
lines changed

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<p align="center">
2-
<a href="https://dscvit.com">
3-
<img src="https://user-images.githubusercontent.com/30529572/92081025-fabe6f00-edb1-11ea-9169-4a8a61a5dd45.png" alt="DSC VIT"/>
4-
</a>
5-
<h2 align="center"> FastAPI Session </h2>
6-
<h4 align="center"> 2CC Session Course API </h4>
2+
<img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" alt="FAST API"/>
3+
<h2 align="center"> FastAPI Template </h2>
4+
<h4 align="center"> A template for the beginners </h4>
75

86

97
---
10-
[![Join Us](https://img.shields.io/badge/Join%20Us-Developer%20Student%20Clubs-red)](https://dsc.community.dev/vellore-institute-of-technology/)
11-
[![Discord Chat](https://img.shields.io/discord/760928671698649098.svg)](https://discord.gg/498KVdSKWR)
8+
## About
9+
This is a beginner's template for getting started with FastAPI.
10+
It uses SQLAlchemy as the ORM.
11+
12+
Contributions are welcome.
1213

1314
## Features
1415

1516
- [x] Database Connection Using SQLAlchemy
1617
- [x] FastAPI Server
18+
- [x] Unit Testing with PyTest
19+
- [x] Basic CRUD for Posts
1720

1821
<br>
1922

@@ -51,6 +54,12 @@ source env/bin/activate # for linux and mac
5154
pip install -r requirements.txt
5255
```
5356

57+
- Setting up environment variables
58+
59+
| Key | Value |
60+
| ----------- | ----------- |
61+
| DATABASE_URL | postgresql://user:password@host:port/db|
62+
5463
- To run the project
5564

5665
```bash
@@ -76,8 +85,4 @@ uvicorn main:app
7685
</p>
7786
</td>
7887
</tr>
79-
</table>
80-
81-
<p align="center">
82-
Made with :heart: by <a href="https://dscvit.com">DSC VIT</a>
83-
</p>
88+
</table>

main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
from fastapi import FastAPI
2+
from fastapi.middleware.cors import CORSMiddleware
23

34
from routes.posts import router
45
from schemas.models import HealthResponse
56

67
app = FastAPI()
78

9+
origins = ["*"]
10+
11+
app.add_middleware(
12+
CORSMiddleware,
13+
allow_origins=origins,
14+
allow_credentials=True,
15+
allow_methods=["*"],
16+
allow_headers=["*"],
17+
)
18+
819
app.include_router(router=router, prefix="/posts")
920

1021

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pluggy==0.13.1
3232
promise==2.3
3333
psycopg2==2.8.6
3434
py==1.10.0
35-
pydantic==1.8.1
35+
pydantic==1.8.2
3636
pyparsing==2.4.7
3737
pytest==6.2.3
3838
pytest-dependency==0.5.1
@@ -50,7 +50,7 @@ toml==0.10.2
5050
typed-ast==1.4.3
5151
typing-extensions==3.7.4.3
5252
ujson==3.2.0
53-
urllib3==1.26.4
53+
urllib3==1.26.5
5454
uvicorn==0.13.4
5555
watchgod==0.7
56-
websockets==8.1
56+
websockets==9.1

0 commit comments

Comments
 (0)