First, extract the ZIP files in a folder, let's call it main.
- Head to Google Developers Console and create a new project (or select the one you have.)
- You will be redirected to the Project Dashboard, there click on “Enable Apis and services”, search for “Sheets API”.
- In the API screen click on ‘ENABLE’ to enable this API.
- Similarly enable the “Drive API”. We require drives api for getting list of spreadsheets, deleting them etc.
- Go to Sheets API screen, then go to “Credentials” tab and choose “Create Credentials > Service Account Key”.
- Next choose the service account as ‘App Engine default’ and Key type as JSON and click create:
- You will now be prompted to download a .json file. This file contains the necessary private key for account authorization. Name the file as 'service_account_sheets.json'.
This is how this file may look like:
{ "type": "service_account", "project_id": "p....sdf", "private_key_id": "48.....", "private_key": "-----BEGIN PRIVATE KEY-----\nNrDyLw … jINQh/9\n-----END PRIVATE KEY-----\n", "client_email": "p.....@appspot.gserviceaccount.com", "client_id": "10.....454", }
- After getting the json file, paste it in the main folder.
Now, to install all the dependencies:
- Open the main folder in the terminal.
- Write this command:
pip install -r requirements.txt
- After all dependencies are installed successfully, run the server:
python manage.py runserver
- Now, you will get a link in the terminal, open that in a browser.