File tree Expand file tree Collapse file tree 3 files changed +31
-15
lines changed
Expand file tree Collapse file tree 3 files changed +31
-15
lines changed Original file line number Diff line number Diff line change 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
5154pip 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 >
Original file line number Diff line number Diff line change 11from fastapi import FastAPI
2+ from fastapi .middleware .cors import CORSMiddleware
23
34from routes .posts import router
45from schemas .models import HealthResponse
56
67app = 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+
819app .include_router (router = router , prefix = "/posts" )
920
1021
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ pluggy==0.13.1
3232promise == 2.3
3333psycopg2 == 2.8.6
3434py == 1.10.0
35- pydantic == 1.8.1
35+ pydantic == 1.8.2
3636pyparsing == 2.4.7
3737pytest == 6.2.3
3838pytest-dependency == 0.5.1
@@ -50,7 +50,7 @@ toml==0.10.2
5050typed-ast == 1.4.3
5151typing-extensions == 3.7.4.3
5252ujson == 3.2.0
53- urllib3 == 1.26.4
53+ urllib3 == 1.26.5
5454uvicorn == 0.13.4
5555watchgod == 0.7
56- websockets == 8 .1
56+ websockets == 9 .1
You can’t perform that action at this time.
0 commit comments