Google calendars django website - django

I am trying to display and maintain a separate Google calendar for each user on my Django website. I also want to synchronize each users' Google calendar on the website, with their actual Google Calendar so that events are maintained and displayed not just on the website, but when they log into their Google Calendar through their Google account.
I have no idea how to approach this. Does anyone know how I can do this?

The first thing you are going to have to do is look into OAuth2 for authentication this will allow you to access your users Google Calendars. You will just need to save the refresh Token for each user then you will be able to access the information again by requesting a new access Token.
After that you should look into the Google Calendar API reference
There is also a Google Client library for python that will probably make things a lot easer. Google APIs Client Library for Python.
I don't have any django or python experience so I cant help you out with any code. But if you get stuck just ask a new question on Stack. These links should at least give you an idea of where to start.

Related

How to access data of my own non-business Instagram account?

I'm looking for the right approach to solve the following problem:
For my own non-business Instagram account I like to read which accounts follow me and which accounts like and comment my posts.
I read about the old and the new API, about API deprecation etc. Now I'm unsure which approach shall I choose?
Instagram Platform API
Graph API
other approach like browser automation (e.g. InstaPy)
Instagram/Facebook says "If you are building apps for Instagram Non-Business Accounts, please use the Instagram Platform API". But the process to get an account seams to be complicated. And as I understand until 2020 Instagram will deprecate this API completely.
Additionally as I understand the sandbox mode doesn't help me, since it is restricted and won't show the real results.
From what I can tell, you should use the Instagram Platform API. I think you're right that the Graph API is only for servicing Business Accounts.
I'm in the same boat. I made an app that lets users sign in with their own non-business accounts. Setup OAuth flow using the old API, which works in sandbox.
However, I submitted for approval this week and haven't heard anything. There's no way to contact Instagram or know how long it will take to get approved.
I personally have some experience with InstaPy and I can tell you that it is used mainly for directly interacting with said accounts. You can follow, comment, like, etc... on these accounts that follow you but actually accessing a list of all of them would be more tricky. That's why I wouldn't recommend browser automation for the goal you have set out for.

Authenticating a Google Drive service account owned by a Django app?

I'm new to Django and relatively new to OAuth. I'm building a Django app that's basically aiming to be a wrapper around Google Drive that implements tagging and user permissions. A few users who have important documents share them with the service account, and then the app provides a nice interface.
I'm generally confused about how to organize this, since Django seems to have many, many moving parts.
The app needs to almost constantly be authenticated with and talking to the Google Drive API.
Where does this authentication go? A model? Is it part of a site template that gets inserted on every page?
Here's sample app of integrating Django with OAuth2. You especially want to take a look at this file where it saves user credential using Storage class. There is also a documentation with better explanation about how OAuth flow with Storage works in Django.
To answer your question, you would want to define credential at Django user profile in order to save it easily associated with users. Also, your OAuth flow (creating auth url and authenticating) works at view.

recommended way for app generated events to get onto users' Google calendars

I run a Django web app that schedules about 50 users for various events. Users login to the site to view their schedule. Of course, each user also wants their events on their personal Google calendar with real time updates.
For privacy reasons, it is important that the app not access the users' own calendars.
My question is: What is the standard (recommended) workflow for a web app to accomplish this?
Based on my reading so far, here's what I' thinking:
Create a dedicated Google account for the app.
Within that account, create a Google calendar for each user.
Share the link to the calendar with each user so they can subscribe to it.
The app updates the calendars via the API.
Is this a good way to go or is there a better way?
Really appreciate any help.

Facebook app requesting Youtube watch history

We are working on an idea of a FB app which let's us retrieve youtube watch histories of app users.
I know there's the possibility to retrieve watch histories through youtube's api, but in combination with a FB app I couldn't find examples.
Any input on this is much appreciated, thanks!
These two are orthogonal. Since you didn't specify a language, I'll assume you're using Python.
Write an FB app using Canvas to display output to users ... I assume you are using Canvas.
Use the YouTube API and Python client to make API calls. You'll need to use a database or some other storage engine to link a user's Facebook API auth token with their Google auth token. Both are using OAuth 2.0 (though they are different flavors), so once you learn one, the other should be easy.
Before I answer anymore questions, it's probably a good idea for you to work through the getting started guides for both Facebook's API and YouTube API first. After you have some understanding of both, pick a stack and you should more or less be ready to go.

Django + Google SSO openid

I would like to have my application http://app.acquee.com/designer to accept a google account as a login. I found a bunch of libs for django but most work on top of existing Django authentication system that I do not use. I have my own set of user tables where I keep user info and privileges.
Any suggestion on how to integrate that with the Google Openid?
Seems I will have to do it manually using python-openid. Or could I use django-openid?
However, with the latter, I don't even know how to issue the discover command.
Regardless, I get stuck on google's step 5, sending a login authentication request (optionally with OAuth parameters) to the provided endpoint address. Can someone provide a sample request? is it a GET/POST? content?
Cheers
You can try https://launchpad.net/django-openid-auth - I'm using it in a commercial project, for both regular Google Accounts and Google Apps accounts. I remember that it was the most convincing one at the time I was doing a review, although I can't give you any details now due to my short memory. Anyway - it's working great.