django-google-auth
=====
django-google-auth project is demo application for codingsoho
Detailed documentation is in the "docs" directory.
Quick start
-----------
# googleauth
1. 安装 django-google-auth2
```
pip3 install django-google-auth2
```
2. 添加 django_google_auth2 到app
```
INSTALLED_APPS = [
...
'django_google_auth2',
]
```
3. 绑定google令牌
```
from django_google_auth2.google.bindgoogleauth.bindgoogleauth import bind_google_auth
bind_google_auth(user)
```
**函数参数:**
|参数名|必选|类型|说明|
|:---- |:---|:----- |----- |
|user |是 |string | 用户名 Or 邮箱 |
**返回参数说明**
|参数名|类型|说明|
|:----- |:-----|----- |
|success |bool | True/False |
|data |string | google令牌字符串(用于生成二维码) |
4. 解绑google令牌
```
from django_google_auth2.google.deletegoogleauth.deletegoogleauth import delete_google_auth
delete_google_auth(user)
```
**函数参数:**
|参数名|必选|类型|说明|
|:---- |:---|:----- |----- |
|user |是 |string | 用户名 Or 邮箱 |
**返回参数说明**
|参数名|类型|说明|
|:----- |:-----|-----|
|success |bool | True/False |
|data |string | 删除成功 |
5. 验证google令牌
```
from django_google_auth2.google.checkgoogleauth.checkgoogleauth import check_google_auth
check_google_auth(user,code)
```
**函数参数:**
|参数名|必选|类型|说明|
|:---- |:---|:----- |----- |
|user |是 |string | 用户名 Or 邮箱 |
|code |是 |string | 客户端动态码 |
**返回参数说明**
|参数名|类型|说明|
|:----- |:-----|-----|
|success |bool | True/False |
6. 绑定google令牌Api接口
urls.py
```
from django_google_auth2.google.bindgoogleauth.bindgoogleauthapi import bind_google_auth_api
urlpatterns = [
...
path('bing-google-auth-api/', bind_google_auth_api),
]
```
**请求方式:**
- POST
**请求示例**
```
{
"user":"cox"
}
```
**函数参数:**
|参数名|必选|类型|说明|
|:---- |:---|:----- |----- |
|user |是 |string | 用户名 Or 邮箱 |
**返回**

7. 客户端(二选一)
> 安卓App
Google令牌+扫码器(如果手机只安装Google令牌App扫码失败,请安装扫码器)
链接:https://pan.baidu.com/s/1XeO7p4IvNuvzQOiZrq4wtw
提取码:e70f
> Chrome插件
https://chrome.google.com/webstore/detail/authenticator/bhghoamapcdpbohphigoooaddinpkbai
Metadata
Release files for django-google-auth2 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-google-auth2-0.0.8.tar.gz | 14.3 kB | Without provenance | Details for django-google-auth2-0.0.8.tar.gz |
Release files / django-google-auth2-0.0.8.tar.gz
| Download URL | django-google-auth2-0.0.8.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0b46bbb687d43998b1aa6b4546b91dad85935cbcde75cbbef13935be89d5a6e
|
|
BLAKE2b-256 checksum How to use checksums |
91f9d1c976139e019ce5b82be4718740bc3f0a75ed8bb311c411f5b0ae7cf76b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4
|
Security for django-google-auth2 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.