存储 Google API OAuth 凭据的 Django 应用程序。
项目描述
将 Google OAuth 凭据存储在 Django ORM 中,以便轻松访问 API 服务。
安装:
将django-google-credentials安装或添加到您的 Python 路径。
将google_credentials添加到您的INSTALLED_APPS设置中。
将google_credentials URL 包括添加到项目的urls.py文件中:
url(r'^google-credentials/', include('google_credentials.urls')),
在Google API Console上创建您的项目,将重定向 URL 指定为http://your.domain.com/google-credentials/callback(或者您如上所述设置urls.py )。
将以下设置添加到项目的settings.py文件中,其中填充了上一步中从 Google 检索到的值,即:
GA_CLIENT_ID = '32749234234.apps.googleusercontent.com' GA_CLIENT_SECRET = 'DKSFY87sd6fHJGdsf6' GA_SCOPE = 'https://www.googleapis.com/auth/analytics.readonly' GA_REDIRECT_URI = 'http://your.domain.com/google-credentials/callback'
运行syncdb以生成所需的模型。
用法
在开始使用服务之前,您必须使用您的 Google 帐户对其进行授权。为此,请在浏览器中打开http://your.domain.com/google-credentials/authorize 。
授权后,您可以检索服务以进行进一步查询,如下所示:
from google_credentials import utils service = utils.get_service()
要清除以前生成的凭据,请在浏览器中打开http://your.domain.com/google-credentials/purge 。
项目详情
关
django_google_credentials -0.0.2-py2.7.egg 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 95834fd2373dbc75e2470fb1686d9aab2e7737e1997bb36e0acc2021807641ff |
|
MD5 | 8ee8e4a68c36a6c19204b705bf421459 |
|
布莱克2-256 | 2b9fcb91b2117bb25f1835d3240895ff858272073810154b1d0e564a46f13da4 |