Skip to content

This repository provides example code for the process involved in connecting Django to Google Calendar API , which involves a Google Cloud Platform Service Account.

Notifications You must be signed in to change notification settings

satshiv7983/django-GoogleCalender-Integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-GoogleCalender-Integration

This repository provides example code for the process involved in connecting Django to Google Calendar API , which involves a Google Cloud Platform Service Account.

Working Snapshot:

image

Got all event details on example Calender

Screenshot (128)

Added demo events through django

Screenshot (129)

Steps

  1. Register for Google Service Account | Using OAuth 2.0 for Server to Server Applications

Follow Google's directions to setup the new credentials here: developers.google.com

  1. Configure a Test Calendar | View your Google Calendar

In the sidebar will be a list of your calendars; click the "+" button and select "Create New Calendar" from the dropdown

Fill in a name "Example", and click the "Create Calendar" button

Hover over this newly created calendar back in the sidebar, and click the three vertical dots, and select "Settings and Sharing" from the dropdown

Scroll down to "share with specific people"

Add your newly created service account email address (it will be "client_email" in your saved credentials file)

Scroll down to "Integrate Calendar" and copy the Calendar ID string, then paste it somewhere safe as you'll need it again soon.

  1. Create Your Local Credentials File | google-credentials.json

Copy paste the entire JSON object from your downloaded credentials file into this newly created .json file. Example: {

"type": "service_account",

"project_id": "example",

"private_key_id": "BLAHBALH",

"private_key": "-----BEGIN PRIVATE KEY-----\nSUUUUUUPER------LONG-------STRING\n-----END PRIVATE KEY-----\n",

"client_email": "[email protected]",

"client_id": "1234567890987654321",

"auth_uri": "https://accounts.google.com/o/oauth2/auth",

"token_uri": "https://oauth2.googleapis.com/token",

"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",

"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/username%40example.iam.gserviceaccount.com"

}
  1. Add The API Calls

    For api refer calender_API.py file

About

This repository provides example code for the process involved in connecting Django to Google Calendar API , which involves a Google Cloud Platform Service Account.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published