Metadata-Version: 2.4
Name: django-sp
Version: 1.23.6
Summary: Django application for custom Social Profile Auth and User model.
Author-email: DLRSP <dlrsp.dev@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/DLRSP/django-sp
Project-URL: Documentation, https://github.com/DLRSP/django-sp/
Project-URL: Repository, https://github.com/DLRSP/django-sp
Project-URL: Issues, https://github.com/DLRSP/django-sp/issues
Project-URL: Changelog, https://github.com/DLRSP/django-sp/blob/main/CHANGELOG.rst
Keywords: django,socialprofile,authentication,oauth,social-auth,2fa,user-profile
Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Internet :: WWW/HTTP :: Session
Classifier: Topic :: Security
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.2
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=3.2
Requires-Dist: django-errors
Requires-Dist: python-social-auth
Requires-Dist: social-auth-app-django
Requires-Dist: django-otp
Requires-Dist: django-two-factor-auth
Requires-Dist: django-oauth-toolkit
Requires-Dist: djangorestframework
Requires-Dist: easy_thumbnails
Requires-Dist: django-cors-headers
Requires-Dist: geoip2
Requires-Dist: django-user-sessions
Requires-Dist: django-axes
Requires-Dist: phonenumbers
Requires-Dist: django-phonenumber-field
Requires-Dist: django-image-cropping
Requires-Dist: django-countries
Requires-Dist: django-crispy-forms
Requires-Dist: sweetify
Provides-Extra: testing
Requires-Dist: coverage; extra == "testing"
Requires-Dist: codecov; extra == "testing"
Requires-Dist: pytest; extra == "testing"
Requires-Dist: pytest-django; extra == "testing"
Provides-Extra: linting
Requires-Dist: flake8; extra == "linting"
Requires-Dist: flake8-pyproject; extra == "linting"
Requires-Dist: flake8-bugbear; extra == "linting"
Requires-Dist: flake8-comprehensions; extra == "linting"
Requires-Dist: flake8-tidy-imports; extra == "linting"
Requires-Dist: flake8-typing-imports; extra == "linting"
Requires-Dist: pylint; extra == "linting"
Dynamic: license-file

# django-sp [![PyPi license](https://img.shields.io/pypi/l/django-sp.svg)](https://pypi.python.org/pypi/django_sp)

## Pypi [![PyPi status](https://img.shields.io/pypi/status/django-sp.svg)](https://pypi.python.org/pypi/django_ps) [![PyPi version](https://img.shields.io/pypi/v/django-sp.svg)](https://pypi.python.org/pypi/django_sp) [![PyPi python version](https://img.shields.io/pypi/pyversions/django-sp.svg)](https://pypi.python.org/pypi/django_sp) [![PyPi downloads](https://img.shields.io/pypi/dm/django-sp.svg)](https://pypi.python.org/pypi/django_sp) [![PyPi downloads](https://img.shields.io/pypi/dw/django-sp.svg)](https://pypi.python.org/pypi/django_sp) [![PyPi downloads](https://img.shields.io/pypi/dd/django-sp.svg)](https://pypi.python.org/pypi/django_sp)

	$ pip install django-sp

## GitHub ![GitHub release](https://img.shields.io/github/tag/DLRSP/django-sp.svg) ![GitHub release](https://img.shields.io/github/release/DLRSP/django-sp.svg)

## Test [![codecov.io](https://codecov.io/github/DLRSP/django-sp/coverage.svg?branch=main)](https://codecov.io/github/DLRSP/django-sp?branch=main)

Report Issues with [***waffle.io***](https://waffle.io/DLRSP/django-sp/join)

## Run Example Project

	$ git clone https://github.com/DLRSP/example -b django-sp
	$ cd example
	$ python manage.py runserver

Now you browser the app @ http://127.0.0.1:8000


from django.contrib.auth import get_user_model
User = get_user_model()
user = User.objects.get(username="dlrsp.dev")
user.is_staff = True
user.is_admin = True
user.is_superuser = True
user.save()


# Get current user model from settings
from django.contrib.auth import get_user_model
User = get_user_model()
user = User.objects.create_user('myemail@crazymail.com', 'mypassword')
user.first_name = 'Tyrone'
user.last_name = 'Citizen'
user.save()

from django.contrib.auth import get_user_model
User = get_user_model()
user = User.objects.create_user('myemail@crazymail.com', 'mypassword', 'myemail')
user.first_name = 'Tyrone'
user.last_name = 'Citizen'
user.save()


# Error
ERROR 2023-12-29 13:19:35,275 log 1728326 139722162782720 Internal Server Error: /it/sp/complete/google-oauth2/
Traceback (most recent call last):
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/django/views/decorators/cache.py", line 62, in _wrapper_view_func
    response = view_func(request, *args, **kwargs)
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/social_django/utils.py", line 49, in wrapper
    return func(request, backend, *args, **kwargs)
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/social_django/views.py", line 31, in complete
    return do_complete(
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/social_core/actions.py", line 49, in do_complete
    user = backend.complete(user=user, *args, **kwargs)
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/social_core/backends/base.py", line 39, in complete
    return self.auth_complete(*args, **kwargs)
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/social_core/utils.py", line 253, in wrapper
    return func(*args, **kwargs)
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/social_core/backends/oauth.py", line 408, in auth_complete
    state = self.validate_state()
  File "/srv/https/horoscopus/venv/lib64/python3.9/site-packages/social_core/backends/oauth.py", line 98, in validate_state
    raise AuthStateMissing(self, "state")
social_core.exceptions.AuthStateMissing: Session value state missing.
[pid: 1728326|app: 0|req: 2/7] 101.58.43.45 () {58 vars in 2160 bytes} [Fri Dec 29 13:19:34 2023] GET /it/sp/complete/google-oauth2/?state=Kj9FhLkpwVsqBWUkgy3q39RHHNGc4VwQ&code=4%2F0AfJohXn_cVSNiHzqdSvVNFQuNFQfLIqVgevVI_nBnxJr-EgCjQaHURyzbrnbKT6agmlPEg&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+openid&authuser=0&prompt=none => generated 14583 bytes in 489667 micros (HTTP/2.0 500) 9 headers in 434 bytes (1 switches on core 0)
[pid: 1728327|app: 0|req: 5/8] 101.58.43.45 () {54 vars in 1672 bytes} [Fri Dec 29 13:19:35 2023] GET /it/jsi18n/ => generated 8405 bytes in 2761 micros (HTTP/2.0 200) 10 headers in 335 bytes (1 switches on core 0)
