Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chanmo/django-social-cn
基于django的社交帐号模块
https://github.com/chanmo/django-social-cn
django-social douyin qq wechat
Last synced: about 1 month ago
JSON representation
基于django的社交帐号模块
- Host: GitHub
- URL: https://github.com/chanmo/django-social-cn
- Owner: ChanMo
- License: mit
- Created: 2019-08-03T06:29:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-04T01:38:20.000Z (over 4 years ago)
- Last Synced: 2024-08-09T05:49:56.307Z (5 months ago)
- Topics: django-social, douyin, qq, wechat
- Language: Python
- Homepage:
- Size: 52.7 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django Social APP
基于django的社交帐号APP
包含微信APP, 微信小程序, 微信公众号, 抖音小程序, QQ开放平台等
## Quick start
1. 更新`settings.py`
```python
INSTALLED_APPS = [
...
'social',
]
```2. 执行`python manage.py migrate`
## Web使用
用于微信web开放平台, 微信公众号, QQ开放平台### AuthView
方式一, 直接使用
修改`urls.py`
```python
from social.views import AuthViewurlpatterns = [
...
path('social//', AuthView.as_view()),
]
```方式二, 继承
修改`views.py````python
from social.views import AuthView as BaseAuthViewclass AuthView(BaseAuthView):
success_url = '/success/'
```## API使用
用于微信APP, 微信小程序, 抖音小程序API使用[django-rest-framework](https://www.django-rest-framework.org/)框架, Token使用[django-rest-framework-simplejwt](https://github.com/davesque/django-rest-framework-simplejwt)
安装依赖
```bash
$ pip install djangorestfamework
$ pip install django-rest-famework-simplejwt```
直接使用
```
from social.apis import AuthView, SocialUpdateViewurlpatterns = [
...
path('social/auth//', AuthView.as_view()),
path('social/update/', SocialUpdateView.as_view()),
]
```