Registration and implementation of Gmail API using Python, Fast API, SQL Alchemy
There are two ways -
- Place the app/credentials/desktop_client_secret.json
- Run the app/first_time.py with the following command
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python app/first_time.py
-
This script will pop up a google login screen asking you to give email and password only one time. Once, the login is successfull, there will be an access-refresh-token.json file will be added automatically in the app folder.
-
Now you can then start the server with
sudo docker-compose up --build
/register api documentation can be found in http://0.0.0.0:8000/docs
If you have a GSUITE admin credentials and the email has domain-wise delegation then place your credentials as service_account_credentials.json in the app/credentials/ folder
- Uncomment the 59th and 72th lines in app/main.py and comment out 56 and 69th lines in the same file
after that run the following command -
virtualenv venv
source venv/bin/activate
sudo docker-compose up --build