-
Clone this repository
git clone https://github.com/anuja-rahul/python-fastAPI.git
-
Create a Virtual environment
python -m venv venv
-
Activate the venv
activate venv
-
Install the packages
pip install -r requirements.txt
-
Setting up the env variables:
required: .env
ex: for dev env
SECRET_KEY="Your Secret Key" ALGORITHM="HS256" ACCESS_TOKEN_EXPIRE_MINUTES="60" HOST="localhost" DBNAME="Your DB name" PORT="8000" USER="Your Username" PASSWORD="Your password"
-
Note: If you have openssl, to generate a
SECRET_KEY
you can run :openssl rand -hex 32
-
-
Start the uvicorn server
uvicorn app.main:app --reload
-
After starting the uvicorn server visit
for
Swagger UI
:http://localhost:8000/docs
or for
Redoc
:http://localhost:8000/redoc