\S+)/$',
views.ProviderAuthView.as_view(),
name='provider-auth'
),
]
djoser-1.1.5/djoser/social/token/ 0000755 0001750 0001750 00000000000 13212504022 020053 5 ustar nimroot nimroot 0000000 0000000 djoser-1.1.5/djoser/social/token/jwt.py 0000644 0001750 0001750 00000000452 13177554046 021257 0 ustar nimroot nimroot 0000000 0000000 class TokenStrategy:
@classmethod
def obtain(cls, user):
from rest_framework_jwt.settings import api_settings
payload = api_settings.JWT_PAYLOAD_HANDLER(user)
return {
'token': api_settings.JWT_ENCODE_HANDLER(payload),
'user': user
}
djoser-1.1.5/djoser/social/token/__init__.py 0000644 0001750 0001750 00000000000 13177462464 022201 0 ustar nimroot nimroot 0000000 0000000 djoser-1.1.5/djoser/social/serializers.py 0000644 0001750 0001750 00000003764 13212472704 021666 0 ustar nimroot nimroot 0000000 0000000 from rest_framework import serializers
from social_core import exceptions
from social_django.utils import load_backend, load_strategy
from djoser.conf import settings
class ProviderAuthSerializer(serializers.Serializer):
# GET auth token
token = serializers.CharField(read_only=True)
user = serializers.CharField(read_only=True)
def create(self, validated_data):
user = validated_data['user']
return settings.SOCIAL_AUTH_TOKEN_STRATEGY.obtain(user)
def validate(self, attrs):
request = self.context['request']
if 'state' in request.GET:
self._validate_state(request.GET['state'])
strategy = load_strategy(request)
redirect_uri = strategy.session_get('redirect_uri')
backend_name = self.context['view'].kwargs['provider']
backend = load_backend(
strategy, backend_name, redirect_uri=redirect_uri
)
try:
user = backend.auth_complete()
except exceptions.AuthException as e:
raise serializers.ValidationError(str(e))
return {'user': user}
def _validate_state(self, value):
request = self.context['request']
strategy = load_strategy(request)
redirect_uri = strategy.session_get('redirect_uri')
backend_name = self.context['view'].kwargs['provider']
backend = load_backend(
strategy, backend_name, redirect_uri=redirect_uri
)
try:
backend.validate_state()
except exceptions.AuthMissingParameter:
raise serializers.ValidationError(
'State could not be found in request data.'
)
except exceptions.AuthStateMissing:
raise serializers.ValidationError(
'State could not be found in server-side session data.'
)
except exceptions.AuthStateForbidden:
raise serializers.ValidationError(
'Invalid state has been provided.'
)
return value
djoser-1.1.5/djoser/social/__init__.py 0000644 0001750 0001750 00000000000 13177462464 021061 0 ustar nimroot nimroot 0000000 0000000 djoser-1.1.5/djoser/compat.py 0000644 0001750 0001750 00000000637 13166200545 017337 0 ustar nimroot nimroot 0000000 0000000 from djoser.conf import settings
__all__ = ['settings']
def get_user_email(user):
email_field_name = get_user_email_field_name(user)
return getattr(user, email_field_name, None)
def get_user_email_field_name(user):
try: # Assume we are Django >= 1.11
return user.get_email_field_name()
except AttributeError: # we are using Django < 1.11
return settings.USER_EMAIL_FIELD_NAME
djoser-1.1.5/djoser/serializers.py 0000644 0001750 0001750 00000021232 13177036027 020406 0 ustar nimroot nimroot 0000000 0000000 from django.contrib.auth import authenticate, get_user_model
from django.contrib.auth.password_validation import validate_password
from django.core import exceptions as django_exceptions
from django.db import IntegrityError, transaction
from rest_framework import exceptions, serializers
from djoser import constants, utils
from djoser.compat import get_user_email, get_user_email_field_name
from djoser.conf import settings
User = get_user_model()
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = tuple(User.REQUIRED_FIELDS) + (
User._meta.pk.name,
User.USERNAME_FIELD,
)
read_only_fields = (User.USERNAME_FIELD,)
def update(self, instance, validated_data):
email_field = get_user_email_field_name(User)
if settings.SEND_ACTIVATION_EMAIL and email_field in validated_data:
instance_email = get_user_email(instance)
if instance_email != validated_data[email_field]:
instance.is_active = False
instance.save(update_fields=['is_active'])
return super(UserSerializer, self).update(instance, validated_data)
class UserCreateSerializer(serializers.ModelSerializer):
password = serializers.CharField(
style={'input_type': 'password'},
write_only=True
)
default_error_messages = {
'cannot_create_user': constants.CANNOT_CREATE_USER_ERROR,
}
class Meta:
model = User
fields = tuple(User.REQUIRED_FIELDS) + (
User.USERNAME_FIELD, User._meta.pk.name, 'password',
)
def validate(self, attrs):
user = User(**attrs)
password = attrs.get('password')
try:
validate_password(password, user)
except django_exceptions.ValidationError as e:
raise serializers.ValidationError({'password': list(e.messages)})
return attrs
def create(self, validated_data):
try:
user = self.perform_create(validated_data)
except IntegrityError:
self.fail('cannot_create_user')
return user
def perform_create(self, validated_data):
with transaction.atomic():
user = User.objects.create_user(**validated_data)
if settings.SEND_ACTIVATION_EMAIL:
user.is_active = False
user.save(update_fields=['is_active'])
return user
class TokenCreateSerializer(serializers.Serializer):
password = serializers.CharField(
required=False, style={'input_type': 'password'}
)
default_error_messages = {
'invalid_credentials': constants.INVALID_CREDENTIALS_ERROR,
'inactive_account': constants.INACTIVE_ACCOUNT_ERROR,
}
def __init__(self, *args, **kwargs):
super(TokenCreateSerializer, self).__init__(*args, **kwargs)
self.user = None
self.fields[User.USERNAME_FIELD] = serializers.CharField(
required=False
)
def validate(self, attrs):
self.user = authenticate(
username=attrs.get(User.USERNAME_FIELD),
password=attrs.get('password')
)
self._validate_user_exists(self.user)
self._validate_user_is_active(self.user)
return attrs
def _validate_user_exists(self, user):
if not user:
self.fail('invalid_credentials')
def _validate_user_is_active(self, user):
if not user.is_active:
self.fail('inactive_account')
class PasswordResetSerializer(serializers.Serializer):
email = serializers.EmailField()
default_error_messages = {'email_not_found': constants.EMAIL_NOT_FOUND}
def validate_email(self, value):
users = self.context['view'].get_users(value)
if settings.PASSWORD_RESET_SHOW_EMAIL_NOT_FOUND and not users:
self.fail('email_not_found')
else:
return value
class UidAndTokenSerializer(serializers.Serializer):
uid = serializers.CharField()
token = serializers.CharField()
default_error_messages = {
'invalid_token': constants.INVALID_TOKEN_ERROR,
'invalid_uid': constants.INVALID_UID_ERROR,
}
def validate_uid(self, value):
try:
uid = utils.decode_uid(value)
self.user = User.objects.get(pk=uid)
except (User.DoesNotExist, ValueError, TypeError, OverflowError):
self.fail('invalid_uid')
return value
def validate(self, attrs):
attrs = super(UidAndTokenSerializer, self).validate(attrs)
is_token_valid = self.context['view'].token_generator.check_token(
self.user, attrs['token']
)
if is_token_valid:
return attrs
else:
self.fail('invalid_token')
class ActivationSerializer(UidAndTokenSerializer):
default_error_messages = {'stale_token': constants.STALE_TOKEN_ERROR}
def validate(self, attrs):
attrs = super(ActivationSerializer, self).validate(attrs)
if not self.user.is_active:
return attrs
raise exceptions.PermissionDenied(self.error_messages['stale_token'])
class PasswordSerializer(serializers.Serializer):
new_password = serializers.CharField(style={'input_type': 'password'})
def validate(self, attrs):
user = self.context['request'].user or self.user
assert user is not None
try:
validate_password(attrs['new_password'], user)
except django_exceptions.ValidationError as e:
raise serializers.ValidationError({
'new_password': list(e.messages)
})
return super(PasswordSerializer, self).validate(attrs)
class PasswordRetypeSerializer(PasswordSerializer):
re_new_password = serializers.CharField(style={'input_type': 'password'})
default_error_messages = {
'password_mismatch': constants.PASSWORD_MISMATCH_ERROR,
}
def validate(self, attrs):
attrs = super(PasswordRetypeSerializer, self).validate(attrs)
if attrs['new_password'] == attrs['re_new_password']:
return attrs
else:
self.fail('password_mismatch')
class CurrentPasswordSerializer(serializers.Serializer):
current_password = serializers.CharField(style={'input_type': 'password'})
default_error_messages = {
'invalid_password': constants.INVALID_PASSWORD_ERROR,
}
def validate_current_password(self, value):
is_password_valid = self.context['request'].user.check_password(value)
if is_password_valid:
return value
else:
self.fail('invalid_password')
class SetPasswordSerializer(PasswordSerializer, CurrentPasswordSerializer):
pass
class SetPasswordRetypeSerializer(PasswordRetypeSerializer,
CurrentPasswordSerializer):
pass
class PasswordResetConfirmSerializer(UidAndTokenSerializer,
PasswordSerializer):
pass
class PasswordResetConfirmRetypeSerializer(UidAndTokenSerializer,
PasswordRetypeSerializer):
pass
class UserDeleteSerializer(CurrentPasswordSerializer):
pass
class SetUsernameSerializer(serializers.ModelSerializer,
CurrentPasswordSerializer):
class Meta(object):
model = User
fields = (User.USERNAME_FIELD, 'current_password')
def __init__(self, *args, **kwargs):
"""
This method should probably be replaced by a better solution.
Its purpose is to replace USERNAME_FIELD with 'new_' + USERNAME_FIELD
so that the new field is being assigned a field for USERNAME_FIELD
"""
super(SetUsernameSerializer, self).__init__(*args, **kwargs)
username_field = User.USERNAME_FIELD
self.fields['new_' + username_field] = self.fields.pop(username_field)
class SetUsernameRetypeSerializer(SetUsernameSerializer):
default_error_messages = {
'username_mismatch': constants.USERNAME_MISMATCH_ERROR.format(
User.USERNAME_FIELD
),
}
def __init__(self, *args, **kwargs):
super(SetUsernameRetypeSerializer, self).__init__(*args, **kwargs)
self.fields['re_new_' + User.USERNAME_FIELD] = serializers.CharField()
def validate(self, attrs):
attrs = super(SetUsernameRetypeSerializer, self).validate(attrs)
new_username = attrs[User.USERNAME_FIELD]
if new_username != attrs['re_new_' + User.USERNAME_FIELD]:
self.fail('username_mismatch')
else:
return attrs
class TokenSerializer(serializers.ModelSerializer):
auth_token = serializers.CharField(source='key')
class Meta:
model = settings.TOKEN_MODEL
fields = ('auth_token',)
djoser-1.1.5/djoser/email.py 0000644 0001750 0001750 00000002173 13172220231 017127 0 ustar nimroot nimroot 0000000 0000000 from django.contrib.auth.tokens import default_token_generator
from templated_mail.mail import BaseEmailMessage
from djoser import utils
from djoser.conf import settings
class ActivationEmail(BaseEmailMessage):
template_name = 'email/activation.html'
def get_context_data(self):
context = super(ActivationEmail, self).get_context_data()
user = context.get('user')
context['uid'] = utils.encode_uid(user.pk)
context['token'] = default_token_generator.make_token(user)
context['url'] = settings.ACTIVATION_URL.format(**context)
return context
class ConfirmationEmail(BaseEmailMessage):
template_name = 'email/confirmation.html'
class PasswordResetEmail(BaseEmailMessage):
template_name = 'email/password_reset.html'
def get_context_data(self):
context = super(PasswordResetEmail, self).get_context_data()
user = context.get('user')
context['uid'] = utils.encode_uid(user.pk)
context['token'] = default_token_generator.make_token(user)
context['url'] = settings.PASSWORD_RESET_CONFIRM_URL.format(**context)
return context
djoser-1.1.5/djoser/constants.py 0000644 0001750 0001750 00000001560 13134346130 020060 0 ustar nimroot nimroot 0000000 0000000 from django.utils.translation import ugettext_lazy as _
INVALID_CREDENTIALS_ERROR = _('Unable to login with provided credentials.')
INACTIVE_ACCOUNT_ERROR = _('User account is disabled.')
INVALID_TOKEN_ERROR = _('Invalid token for given user.')
INVALID_UID_ERROR = _('Invalid user id or user doesn\'t exist.')
STALE_TOKEN_ERROR = _('Stale token for given user.')
PASSWORD_MISMATCH_ERROR = _('The two password fields didn\'t match.')
USERNAME_MISMATCH_ERROR = _('The two {0} fields didn\'t match.')
INVALID_PASSWORD_ERROR = _('Invalid password.')
EMAIL_NOT_FOUND = _('User with given email does not exist.')
CANNOT_CREATE_USER_ERROR = _('Unable to create account.')
USER_WITHOUT_EMAIL_FIELD_ERROR = _(
'User model does not contain specified email field. '
'Please see http://djoser.readthedocs.io/en/latest/settings.html#'
'USER_EMAIL_FIELD_NAME for more details.'
)
djoser-1.1.5/djoser/urls/ 0000755 0001750 0001750 00000000000 13212504022 016446 5 ustar nimroot nimroot 0000000 0000000 djoser-1.1.5/djoser/urls/authtoken.py 0000644 0001750 0001750 00000000464 13166203501 021034 0 ustar nimroot nimroot 0000000 0000000 from django.conf.urls import url
from djoser import views
urlpatterns = [
url(
r'^token/create/$',
views.TokenCreateView.as_view(),
name='token-create'
),
url(
r'^token/destroy/$',
views.TokenDestroyView.as_view(),
name='token-destroy'
),
]
djoser-1.1.5/djoser/urls/jwt.py 0000644 0001750 0001750 00000000455 13163500113 017632 0 ustar nimroot nimroot 0000000 0000000 from django.conf.urls import url
from rest_framework_jwt import views
urlpatterns = [
url(r'^jwt/create/', views.obtain_jwt_token, name='jwt-create'),
url(r'^jwt/refresh/', views.refresh_jwt_token, name='jwt-refresh'),
url(r'^jwt/verify/', views.verify_jwt_token, name='jwt-verify'),
]
djoser-1.1.5/djoser/urls/base.py 0000644 0001750 0001750 00000002061 13164466040 017746 0 ustar nimroot nimroot 0000000 0000000 from django.conf.urls import url
from django.contrib.auth import get_user_model
from djoser import views
User = get_user_model()
urlpatterns = [
url(r'^me/$', views.UserView.as_view(), name='user'),
url(
r'^users/create/$',
views.UserCreateView.as_view(),
name='user-create'
),
url(
r'^users/delete/$',
views.UserDeleteView.as_view(),
name='user-delete'
),
url(
r'^users/activate/$',
views.ActivationView.as_view(),
name='user-activate'
),
url(
r'^{0}/$'.format(User.USERNAME_FIELD),
views.SetUsernameView.as_view(),
name='set_username'
),
url(r'^password/$', views.SetPasswordView.as_view(), name='set_password'),
url(
r'^password/reset/$',
views.PasswordResetView.as_view(),
name='password_reset'
),
url(
r'^password/reset/confirm/$',
views.PasswordResetConfirmView.as_view(),
name='password_reset_confirm'
),
url(r'^$', views.RootView.as_view(), name='root'),
]
djoser-1.1.5/djoser/urls/__init__.py 0000644 0001750 0001750 00000000071 13145541001 020560 0 ustar nimroot nimroot 0000000 0000000 from .base import urlpatterns
__all__ = ['urlpatterns']
djoser-1.1.5/djoser/__init__.py 0000644 0001750 0001750 00000000000 13120707604 017571 0 ustar nimroot nimroot 0000000 0000000 djoser-1.1.5/djoser/signals.py 0000644 0001750 0001750 00000000343 13120707604 017504 0 ustar nimroot nimroot 0000000 0000000 from django.dispatch import Signal
# New user has registered.
user_registered = Signal(providing_args=["user", "request"])
# User has activated his or her account.
user_activated = Signal(providing_args=["user", "request"])
djoser-1.1.5/djoser/templates/ 0000755 0001750 0001750 00000000000 13212504022 017457 5 ustar nimroot nimroot 0000000 0000000 djoser-1.1.5/djoser/templates/email/ 0000755 0001750 0001750 00000000000 13212504022 020546 5 ustar nimroot nimroot 0000000 0000000 djoser-1.1.5/djoser/templates/email/activation.html 0000644 0001750 0001750 00000001750 13161165470 023615 0 ustar nimroot nimroot 0000000 0000000 {% load i18n %}
{% block subject %}
{% blocktrans %}Account activation on {{ site_name }}{% endblocktrans %}
{% endblock subject %}
{% block text_body %}
{% blocktrans %}You're receiving this email because you need to finish activation process on {{ site_name }}.{% endblocktrans %}
{% trans "Please go to the following page to activate account:" %}
{{ protocol }}://{{ domain }}/{{ url }}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endblock text_body %}
{% block html_body %}
{% blocktrans %}
You're receiving this email because you need to finish activation process on {{ site_name }}.
{% endblocktrans %}
{% trans "Please go to the following page to activate account:" %}
{{ protocol }}://{{ domain }}/{{ url }}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endblock html_body %}
djoser-1.1.5/djoser/templates/email/password_reset.html 0000644 0001750 0001750 00000002261 13161165470 024516 0 ustar nimroot nimroot 0000000 0000000 {% load i18n %}
{% block subject %}
{% blocktrans %}Password reset on {{ site_name }}{% endblocktrans %}
{% endblock subject %}
{% block text_body %}
{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
{% trans "Please go to the following page and choose a new password:" %}
{{ protocol }}://{{ domain }}/{{ url }}
{% trans "Your username, in case you've forgotten:" %} {{ user.get_username }}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endblock text_body %}
{% block html_body %}
{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
{% trans "Please go to the following page and choose a new password:" %}
{{ protocol }}://{{ domain }}/{{ url }}
{% trans "Your username, in case you've forgotten:" %} {{ user.get_username }}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endblock html_body %}
djoser-1.1.5/djoser/templates/email/confirmation.html 0000644 0001750 0001750 00000001150 13161165470 024136 0 ustar nimroot nimroot 0000000 0000000 {% load i18n %}
{% block subject %}
{% blocktrans %}{{ site_name }} - Your account has been successfully created and activated!{% endblocktrans %}
{% endblock %}
{% block text_body %}
{% trans "Your account has been created and is ready to use!" %}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endblock text_body %}
{% block html_body %}
{% trans "Your account has been created and is ready to use!" %}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endblock html_body %}
djoser-1.1.5/PKG-INFO 0000644 0001750 0001750 00000012172 13212504022 015273 0 ustar nimroot nimroot 0000000 0000000 Metadata-Version: 1.1
Name: djoser
Version: 1.1.5
Summary: REST version of Django authentication system.
Home-page: https://github.com/sunscrapers/djoser
Author: SUNSCRAPERS
Author-email: info@sunscrapers.com
License: MIT
Description-Content-Type: UNKNOWN
Description: ======
djoser
======
.. image:: https://img.shields.io/pypi/v/djoser.svg
:target: https://pypi.org/project/djoser
.. image:: https://img.shields.io/travis/sunscrapers/djoser.svg
:target: https://travis-ci.org/sunscrapers/djoser
.. image:: https://img.shields.io/codecov/c/github/sunscrapers/djoser.svg
:target: https://codecov.io/gh/sunscrapers/djoser
.. image:: https://img.shields.io/scrutinizer/g/sunscrapers/djoser.svg
:target: https://scrutinizer-ci.com/g/sunscrapers/djoser
REST implementation of `Django `_ authentication
system. **djoser** library provides a set of `Django Rest Framework `_
views to handle basic actions such as registration, login, logout, password
reset and account activation. It works with
`custom user model `_.
Instead of reusing Django code (e.g. ``PasswordResetForm``), we reimplemented
few things to fit better into `Single Page App `_
architecture.
Developed by `SUNSCRAPERS `_ with passion & patience.
.. image:: https://asciinema.org/a/FBTYjfDPUr99jxZqbLOZhh9Pd.png
:target: https://asciinema.org/a/FBTYjfDPUr99jxZqbLOZhh9Pd?autoplay=1&speed=2
Requirements
============
To be able to run **djoser** you have to meet following requirements:
- Python (2.7, 3.4, 3.5, 3.6)
- Django (1.10, 1.11)
- Django REST Framework (3.7)
Installation
============
Simply install using ``pip``:
.. code-block:: bash
$ pip install djoser
And continue with the steps described at
`configuration `_
guide.
Documentation
=============
Documentation is available to study at
`http://djoser.readthedocs.io `_
and in ``docs`` directory.
Contributing and development
============================
To start developing on **djoser**, clone the repository:
.. code-block:: bash
$ git clone git@github.com:sunscrapers/djoser.git
If you are a **pipenv** user you can quickly setup testing environment by
using Make commands:
.. code-block:: bash
$ make init
$ make test
Otherwise, if you cannot use Make commands, please create virtualenv and install
requirements manually:
.. code-block:: bash
$ pip install django djangorestframework
$ pip install -r requirements.txt
If you are running djoser tests on Python 2.7 you also need to install **mock** library.
.. code-block:: bash
$ pip install mock # only on Python 2.7
$ cd testproject
$ ./manage.py test
If you need to run tests against all supported Python and Django versions then invoke:
.. code-block:: bash
$ pip install tox
$ tox
You can also play with test project by running following commands:
.. code-block:: bash
$ ./manage.py migrate
$ ./manage.py runserver
Similar projects
================
List of projects related to Django, REST and authentication:
- `django-rest-framework-jwt `_
- `django-oauth-toolkit `_
- `django-rest-auth `_
- `django-rest-framework-digestauth `_ (not maintained)
- `doac `_ (not maintained)
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.10
Classifier: Framework :: Django :: 1.11
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
djoser-1.1.5/setup.cfg 0000644 0001750 0001750 00000000046 13212504022 016014 0 ustar nimroot nimroot 0000000 0000000 [egg_info]
tag_build =
tag_date = 0
djoser-1.1.5/LICENSE 0000644 0001750 0001750 00000002066 13120707604 015215 0 ustar nimroot nimroot 0000000 0000000 The MIT License (MIT)
Copyright (c) 2013 SUNSCRAPERS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
djoser-1.1.5/MANIFEST.in 0000644 0001750 0001750 00000000145 13163131753 015745 0 ustar nimroot nimroot 0000000 0000000 include README.md
include LICENSE
recursive-include djoser/templates *.html
include requirements.txt
djoser-1.1.5/requirements.txt 0000644 0001750 0001750 00000000277 13177462464 017514 0 ustar nimroot nimroot 0000000 0000000 -e .
django-templated-mail==1.0.0
djangorestframework-jwt==1.11.0
djet==0.2.1
social-auth-app-django==2.0.0
coverage==4.3.1
pytest==3.1.3
pytest-cov==2.5.1
pytest-django==3.1.2
flake8==3.4.1 djoser-1.1.5/djoser.egg-info/ 0000755 0001750 0001750 00000000000 13212504022 017153 5 ustar nimroot nimroot 0000000 0000000 djoser-1.1.5/djoser.egg-info/PKG-INFO 0000644 0001750 0001750 00000012172 13212504022 020253 0 ustar nimroot nimroot 0000000 0000000 Metadata-Version: 1.1
Name: djoser
Version: 1.1.5
Summary: REST version of Django authentication system.
Home-page: https://github.com/sunscrapers/djoser
Author: SUNSCRAPERS
Author-email: info@sunscrapers.com
License: MIT
Description-Content-Type: UNKNOWN
Description: ======
djoser
======
.. image:: https://img.shields.io/pypi/v/djoser.svg
:target: https://pypi.org/project/djoser
.. image:: https://img.shields.io/travis/sunscrapers/djoser.svg
:target: https://travis-ci.org/sunscrapers/djoser
.. image:: https://img.shields.io/codecov/c/github/sunscrapers/djoser.svg
:target: https://codecov.io/gh/sunscrapers/djoser
.. image:: https://img.shields.io/scrutinizer/g/sunscrapers/djoser.svg
:target: https://scrutinizer-ci.com/g/sunscrapers/djoser
REST implementation of `Django `_ authentication
system. **djoser** library provides a set of `Django Rest Framework `_
views to handle basic actions such as registration, login, logout, password
reset and account activation. It works with
`custom user model `_.
Instead of reusing Django code (e.g. ``PasswordResetForm``), we reimplemented
few things to fit better into `Single Page App `_
architecture.
Developed by `SUNSCRAPERS `_ with passion & patience.
.. image:: https://asciinema.org/a/FBTYjfDPUr99jxZqbLOZhh9Pd.png
:target: https://asciinema.org/a/FBTYjfDPUr99jxZqbLOZhh9Pd?autoplay=1&speed=2
Requirements
============
To be able to run **djoser** you have to meet following requirements:
- Python (2.7, 3.4, 3.5, 3.6)
- Django (1.10, 1.11)
- Django REST Framework (3.7)
Installation
============
Simply install using ``pip``:
.. code-block:: bash
$ pip install djoser
And continue with the steps described at
`configuration `_
guide.
Documentation
=============
Documentation is available to study at
`http://djoser.readthedocs.io `_
and in ``docs`` directory.
Contributing and development
============================
To start developing on **djoser**, clone the repository:
.. code-block:: bash
$ git clone git@github.com:sunscrapers/djoser.git
If you are a **pipenv** user you can quickly setup testing environment by
using Make commands:
.. code-block:: bash
$ make init
$ make test
Otherwise, if you cannot use Make commands, please create virtualenv and install
requirements manually:
.. code-block:: bash
$ pip install django djangorestframework
$ pip install -r requirements.txt
If you are running djoser tests on Python 2.7 you also need to install **mock** library.
.. code-block:: bash
$ pip install mock # only on Python 2.7
$ cd testproject
$ ./manage.py test
If you need to run tests against all supported Python and Django versions then invoke:
.. code-block:: bash
$ pip install tox
$ tox
You can also play with test project by running following commands:
.. code-block:: bash
$ ./manage.py migrate
$ ./manage.py runserver
Similar projects
================
List of projects related to Django, REST and authentication:
- `django-rest-framework-jwt `_
- `django-oauth-toolkit `_
- `django-rest-auth `_
- `django-rest-framework-digestauth `_ (not maintained)
- `doac `_ (not maintained)
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.10
Classifier: Framework :: Django :: 1.11
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
djoser-1.1.5/djoser.egg-info/dependency_links.txt 0000644 0001750 0001750 00000000001 13212504022 023221 0 ustar nimroot nimroot 0000000 0000000
djoser-1.1.5/djoser.egg-info/SOURCES.txt 0000644 0001750 0001750 00000001456 13212504022 021045 0 ustar nimroot nimroot 0000000 0000000 LICENSE
MANIFEST.in
README.rst
requirements.txt
setup.cfg
setup.py
djoser/__init__.py
djoser/compat.py
djoser/conf.py
djoser/constants.py
djoser/email.py
djoser/serializers.py
djoser/signals.py
djoser/utils.py
djoser/views.py
djoser.egg-info/PKG-INFO
djoser.egg-info/SOURCES.txt
djoser.egg-info/dependency_links.txt
djoser.egg-info/requires.txt
djoser.egg-info/top_level.txt
djoser/social/__init__.py
djoser/social/serializers.py
djoser/social/urls.py
djoser/social/views.py
djoser/social/backends/__init__.py
djoser/social/backends/facebook.py
djoser/social/token/__init__.py
djoser/social/token/jwt.py
djoser/templates/email/activation.html
djoser/templates/email/confirmation.html
djoser/templates/email/password_reset.html
djoser/urls/__init__.py
djoser/urls/authtoken.py
djoser/urls/base.py
djoser/urls/jwt.py djoser-1.1.5/djoser.egg-info/top_level.txt 0000644 0001750 0001750 00000000114 13212504022 021701 0 ustar nimroot nimroot 0000000 0000000 djoser
djoser/social
djoser/social/backends
djoser/social/token
djoser/urls
djoser-1.1.5/djoser.egg-info/requires.txt 0000644 0001750 0001750 00000000026 13212504022 021551 0 ustar nimroot nimroot 0000000 0000000 django-templated-mail
djoser-1.1.5/setup.py 0000644 0001750 0001750 00000002357 13212503600 015715 0 ustar nimroot nimroot 0000000 0000000 #!/usr/bin/env python
import os
from setuptools import setup
with open('README.rst', 'r') as f:
readme = f.read()
def get_packages(package):
return [
dirpath for dirpath, dirnames, filenames in os.walk(package)
if os.path.exists(os.path.join(dirpath, '__init__.py'))
]
setup(
name='djoser',
version='1.1.5',
packages=get_packages('djoser'),
license='MIT',
author='SUNSCRAPERS',
description='REST version of Django authentication system.',
author_email='info@sunscrapers.com',
long_description=readme,
install_requires=['django-templated-mail'],
include_package_data=True,
url='https://github.com/sunscrapers/djoser',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
]
)