Skip to main content

Django Social APP

基于django的社交帐号APP

包含微信APP, 微信小程序, 微信公众号, 抖音小程序, QQ开放平台等

Quick start

  1. 更新settings.py
INSTALLED_APPS = [
    ...
    'social',
]
  1. 执行python manage.py migrate

Web使用

AuthView

from social.views.AuthView

方式一, 直接使用 修改urls.py

from social.views import AuthView

urlpatterns = [
    ...
    path('social/<slug:provider>/', AuthView.as_view()),
]

方式二, 继承 修改views.py

from social.views import AuthView as BaseAuthView

class AuthView(BaseAuthView):
    success_url = '/success/'

API使用

API使用django-rest-framework框架, Token使用django-rest-framework-simplejwt

安装依赖

$ pip install djangorestfamework
$ pip install django-rest-famework-simplejwt

直接使用

from social.apis import AuthView, SocialUpdateView

urlpatterns = [
    ...
    path('social/auth/<slug:provider>/', AuthView.as_view()),
    path('social/update/', SocialUpdateView.as_view()),
]

Metadata

Release files for django-social-cn 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-social-cn 0.1.1
File Size Uploaded
django-social-cn-0.1.1.tar.gz 9.2 kB Details

Release files / django-social-cn-0.1.1.tar.gz

Download URL django-social-cn-0.1.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2f2617c0372312a1e9e49527594311121734cd978d2c93e8a3bc799d5db4b419
BLAKE2b-256 checksum
How to use checksums
75ea2291cbdeac7720ac973d07461a38bbe65cc0085abfc0b4f450b9e14d2e0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page