diff --git a/.travis.yml b/.travis.yml index b059c1e..33f42ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,9 @@ env: install: - pip install -q Django==$DJANGO djangorestframework==$DRF - pip install coveralls - - pip install -r rest_auth/tests/requirements.pip + - pip install -r dj_rest_auth/tests/requirements.pip script: - - coverage run --source=rest_auth setup.py test + - coverage run --source=dj_rest_auth setup.py test after_success: - coveralls before_script: diff --git a/AUTHORS b/AUTHORS index 21906da..c5ba2ed 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1 +1 @@ -http://github.com/Tivix/django-rest-auth/contributors +http://github.com/iMerica/dj-rest-auth/contributors diff --git a/LICENSE b/LICENSE index 1e3b853..f868a2a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Tivix +Copyright (c) 2014 iMerica Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ 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. \ No newline at end of file +SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in index 01a589f..c2d4208 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,4 +2,4 @@ include AUTHORS include LICENSE include MANIFEST.in include README.md -graft rest_auth +graft dj_rest_auth diff --git a/README.rst b/README.rst index ac7f19e..f79511f 100644 --- a/README.rst +++ b/README.rst @@ -1,31 +1,31 @@ -Welcome to django-rest-auth +Welcome to dj-rest-auth =========================== -.. image:: https://travis-ci.org/Tivix/django-rest-auth.svg - :target: https://travis-ci.org/Tivix/django-rest-auth +.. image:: https://travis-ci.org/iMerica/dj-rest-auth.svg + :target: https://travis-ci.org/iMerica/dj-rest-auth -.. image:: https://coveralls.io/repos/Tivix/django-rest-auth/badge.svg - :target: https://coveralls.io/r/Tivix/django-rest-auth?branch=master +.. image:: https://coveralls.io/repos/iMerica/dj-rest-auth/badge.svg + :target: https://coveralls.io/r/iMerica/dj-rest-auth?branch=master -.. image:: https://readthedocs.org/projects/django-rest-auth/badge/?version=latest - :target: https://readthedocs.org/projects/django-rest-auth/?badge=latest +.. image:: https://readthedocs.org/projects/dj-rest-auth/badge/?version=latest + :target: https://readthedocs.org/projects/dj-rest-auth/?badge=latest -Django-rest-auth provides a set of REST API endpoints for Authentication and Registration +Django-dj-rest-auth provides a set of REST API endpoints for Authentication and Registration Documentation ------------- -http://django-rest-auth.readthedocs.org/en/latest/ +http://dj-rest-auth.readthedocs.org/en/latest/ Source code ----------- -https://github.com/Tivix/django-rest-auth +https://github.com/iMerica/dj-rest-auth Stack Overflow ----------- -http://stackoverflow.com/questions/tagged/django-rest-auth +http://stackoverflow.com/questions/tagged/dj-rest-auth diff --git a/demo/demo/settings.py b/demo/demo/settings.py index 514a8fb..df6807a 100644 --- a/demo/demo/settings.py +++ b/demo/demo/settings.py @@ -37,11 +37,11 @@ INSTALLED_APPS = ( 'rest_framework', 'rest_framework.authtoken', - 'rest_auth', + 'dj_rest_auth', 'allauth', 'allauth.account', - 'rest_auth.registration', + 'dj_rest_auth.registration', 'allauth.socialaccount', 'allauth.socialaccount.providers.facebook', 'rest_framework_swagger', diff --git a/demo/demo/urls.py b/demo/demo/urls.py index af7d38b..787c6e9 100644 --- a/demo/demo/urls.py +++ b/demo/demo/urls.py @@ -35,8 +35,8 @@ urlpatterns = [ TemplateView.as_view(template_name="password_reset_confirm.html"), name='password_reset_confirm'), - url(r'^rest-auth/', include('rest_auth.urls')), - url(r'^rest-auth/registration/', include('rest_auth.registration.urls')), + url(r'^dj-rest-auth/', include('dj_rest_auth.urls')), + url(r'^dj-rest-auth/registration/', include('dj_rest_auth.registration.urls')), url(r'^account/', include('allauth.urls')), url(r'^admin/', admin.site.urls), url(r'^accounts/profile/$', RedirectView.as_view(url='/', permanent=True), name='profile-redirect'), diff --git a/demo/requirements.pip b/demo/requirements.pip index 40b4820..c6f5f42 100644 --- a/demo/requirements.pip +++ b/demo/requirements.pip @@ -1,5 +1,5 @@ django>=1.9.0 -django-rest-auth==0.9.5 +dj-rest-auth==0.9.5 djangorestframework>=3.7.0 django-allauth>=0.24.1 six==1.9.0 diff --git a/demo/templates/base.html b/demo/templates/base.html index cbf02b6..47e4e64 100644 --- a/demo/templates/base.html +++ b/demo/templates/base.html @@ -4,10 +4,10 @@ - - + + - django-rest-auth demo + dj-rest-auth demo @@ -53,13 +53,13 @@ - django-rest-auth demo + dj-rest-auth demo diff --git a/demo/templates/home.html b/demo/templates/home.html index 134198a..ecc6f7c 100644 --- a/demo/templates/home.html +++ b/demo/templates/home.html @@ -3,7 +3,7 @@ {% block content %}
-

django-rest-auth demo

-

Welcome in django-rest-auth demo project!

+

dj-rest-auth demo

+

Welcome in dj-rest-auth demo project!

{% endblock %} diff --git a/rest_auth/__init__.py b/dj_rest_auth/__init__.py similarity index 100% rename from rest_auth/__init__.py rename to dj_rest_auth/__init__.py diff --git a/rest_auth/admin.py b/dj_rest_auth/admin.py similarity index 100% rename from rest_auth/admin.py rename to dj_rest_auth/admin.py diff --git a/rest_auth/app_settings.py b/dj_rest_auth/app_settings.py similarity index 97% rename from rest_auth/app_settings.py rename to dj_rest_auth/app_settings.py index 1b75fe6..9974c2d 100644 --- a/rest_auth/app_settings.py +++ b/dj_rest_auth/app_settings.py @@ -1,6 +1,6 @@ from django.conf import settings -from rest_auth.serializers import ( +from dj_rest_auth.serializers import ( TokenSerializer as DefaultTokenSerializer, JWTSerializer as DefaultJWTSerializer, UserDetailsSerializer as DefaultUserDetailsSerializer, diff --git a/rest_auth/locale/cs/LC_MESSAGES/django.mo b/dj_rest_auth/locale/cs/LC_MESSAGES/django.mo similarity index 100% rename from rest_auth/locale/cs/LC_MESSAGES/django.mo rename to dj_rest_auth/locale/cs/LC_MESSAGES/django.mo diff --git a/rest_auth/locale/cs/LC_MESSAGES/django.po b/dj_rest_auth/locale/cs/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/cs/LC_MESSAGES/django.po rename to dj_rest_auth/locale/cs/LC_MESSAGES/django.po diff --git a/rest_auth/locale/de/LC_MESSAGES/django.mo b/dj_rest_auth/locale/de/LC_MESSAGES/django.mo similarity index 100% rename from rest_auth/locale/de/LC_MESSAGES/django.mo rename to dj_rest_auth/locale/de/LC_MESSAGES/django.mo diff --git a/rest_auth/locale/de/LC_MESSAGES/django.po b/dj_rest_auth/locale/de/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/de/LC_MESSAGES/django.po rename to dj_rest_auth/locale/de/LC_MESSAGES/django.po diff --git a/rest_auth/locale/es/LC_MESSAGES/django.mo b/dj_rest_auth/locale/es/LC_MESSAGES/django.mo similarity index 100% rename from rest_auth/locale/es/LC_MESSAGES/django.mo rename to dj_rest_auth/locale/es/LC_MESSAGES/django.mo diff --git a/rest_auth/locale/es/LC_MESSAGES/django.po b/dj_rest_auth/locale/es/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/es/LC_MESSAGES/django.po rename to dj_rest_auth/locale/es/LC_MESSAGES/django.po diff --git a/rest_auth/locale/fr/LC_MESSAGES/django.mo b/dj_rest_auth/locale/fr/LC_MESSAGES/django.mo similarity index 100% rename from rest_auth/locale/fr/LC_MESSAGES/django.mo rename to dj_rest_auth/locale/fr/LC_MESSAGES/django.mo diff --git a/rest_auth/locale/fr/LC_MESSAGES/django.po b/dj_rest_auth/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/fr/LC_MESSAGES/django.po rename to dj_rest_auth/locale/fr/LC_MESSAGES/django.po diff --git a/rest_auth/locale/ko/LC_MESSAGES/django.mo b/dj_rest_auth/locale/ko/LC_MESSAGES/django.mo similarity index 100% rename from rest_auth/locale/ko/LC_MESSAGES/django.mo rename to dj_rest_auth/locale/ko/LC_MESSAGES/django.mo diff --git a/rest_auth/locale/ko/LC_MESSAGES/django.po b/dj_rest_auth/locale/ko/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/ko/LC_MESSAGES/django.po rename to dj_rest_auth/locale/ko/LC_MESSAGES/django.po diff --git a/rest_auth/locale/pl/LC_MESSAGES/django.mo b/dj_rest_auth/locale/pl/LC_MESSAGES/django.mo similarity index 100% rename from rest_auth/locale/pl/LC_MESSAGES/django.mo rename to dj_rest_auth/locale/pl/LC_MESSAGES/django.mo diff --git a/rest_auth/locale/pl/LC_MESSAGES/django.po b/dj_rest_auth/locale/pl/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/pl/LC_MESSAGES/django.po rename to dj_rest_auth/locale/pl/LC_MESSAGES/django.po diff --git a/rest_auth/locale/pt_BR/LC_MESSAGES/django.po b/dj_rest_auth/locale/pt_BR/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/pt_BR/LC_MESSAGES/django.po rename to dj_rest_auth/locale/pt_BR/LC_MESSAGES/django.po diff --git a/rest_auth/locale/ru/LC_MESSAGES/django.mo b/dj_rest_auth/locale/ru/LC_MESSAGES/django.mo similarity index 100% rename from rest_auth/locale/ru/LC_MESSAGES/django.mo rename to dj_rest_auth/locale/ru/LC_MESSAGES/django.mo diff --git a/rest_auth/locale/ru/LC_MESSAGES/django.po b/dj_rest_auth/locale/ru/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/ru/LC_MESSAGES/django.po rename to dj_rest_auth/locale/ru/LC_MESSAGES/django.po diff --git a/rest_auth/locale/tr/LC_MESSAGES/django.po b/dj_rest_auth/locale/tr/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/tr/LC_MESSAGES/django.po rename to dj_rest_auth/locale/tr/LC_MESSAGES/django.po diff --git a/rest_auth/locale/zh_Hans/LC_MESSAGES/django.mo b/dj_rest_auth/locale/zh_Hans/LC_MESSAGES/django.mo similarity index 100% rename from rest_auth/locale/zh_Hans/LC_MESSAGES/django.mo rename to dj_rest_auth/locale/zh_Hans/LC_MESSAGES/django.mo diff --git a/rest_auth/locale/zh_Hans/LC_MESSAGES/django.po b/dj_rest_auth/locale/zh_Hans/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/zh_Hans/LC_MESSAGES/django.po rename to dj_rest_auth/locale/zh_Hans/LC_MESSAGES/django.po diff --git a/rest_auth/locale/zh_Hant/LC_MESSAGES/django.mo b/dj_rest_auth/locale/zh_Hant/LC_MESSAGES/django.mo similarity index 100% rename from rest_auth/locale/zh_Hant/LC_MESSAGES/django.mo rename to dj_rest_auth/locale/zh_Hant/LC_MESSAGES/django.mo diff --git a/rest_auth/locale/zh_Hant/LC_MESSAGES/django.po b/dj_rest_auth/locale/zh_Hant/LC_MESSAGES/django.po similarity index 100% rename from rest_auth/locale/zh_Hant/LC_MESSAGES/django.po rename to dj_rest_auth/locale/zh_Hant/LC_MESSAGES/django.po diff --git a/rest_auth/models.py b/dj_rest_auth/models.py similarity index 100% rename from rest_auth/models.py rename to dj_rest_auth/models.py diff --git a/rest_auth/registration/__init__.py b/dj_rest_auth/registration/__init__.py similarity index 100% rename from rest_auth/registration/__init__.py rename to dj_rest_auth/registration/__init__.py diff --git a/rest_auth/registration/app_settings.py b/dj_rest_auth/registration/app_settings.py similarity index 100% rename from rest_auth/registration/app_settings.py rename to dj_rest_auth/registration/app_settings.py diff --git a/rest_auth/registration/serializers.py b/dj_rest_auth/registration/serializers.py similarity index 100% rename from rest_auth/registration/serializers.py rename to dj_rest_auth/registration/serializers.py diff --git a/rest_auth/registration/urls.py b/dj_rest_auth/registration/urls.py similarity index 100% rename from rest_auth/registration/urls.py rename to dj_rest_auth/registration/urls.py diff --git a/rest_auth/registration/views.py b/dj_rest_auth/registration/views.py similarity index 100% rename from rest_auth/registration/views.py rename to dj_rest_auth/registration/views.py diff --git a/rest_auth/serializers.py b/dj_rest_auth/serializers.py similarity index 100% rename from rest_auth/serializers.py rename to dj_rest_auth/serializers.py diff --git a/rest_auth/social_serializers.py b/dj_rest_auth/social_serializers.py similarity index 100% rename from rest_auth/social_serializers.py rename to dj_rest_auth/social_serializers.py diff --git a/rest_auth/tests/__init__.py b/dj_rest_auth/tests/__init__.py similarity index 100% rename from rest_auth/tests/__init__.py rename to dj_rest_auth/tests/__init__.py diff --git a/rest_auth/tests/django_urls.py b/dj_rest_auth/tests/django_urls.py similarity index 100% rename from rest_auth/tests/django_urls.py rename to dj_rest_auth/tests/django_urls.py diff --git a/rest_auth/tests/mixins.py b/dj_rest_auth/tests/mixins.py similarity index 100% rename from rest_auth/tests/mixins.py rename to dj_rest_auth/tests/mixins.py diff --git a/rest_auth/tests/requirements.pip b/dj_rest_auth/tests/requirements.pip similarity index 100% rename from rest_auth/tests/requirements.pip rename to dj_rest_auth/tests/requirements.pip diff --git a/rest_auth/tests/settings.py b/dj_rest_auth/tests/settings.py similarity index 100% rename from rest_auth/tests/settings.py rename to dj_rest_auth/tests/settings.py diff --git a/rest_auth/tests/test_api.py b/dj_rest_auth/tests/test_api.py similarity index 100% rename from rest_auth/tests/test_api.py rename to dj_rest_auth/tests/test_api.py diff --git a/rest_auth/tests/test_social.py b/dj_rest_auth/tests/test_social.py similarity index 100% rename from rest_auth/tests/test_social.py rename to dj_rest_auth/tests/test_social.py diff --git a/rest_auth/tests/urls.py b/dj_rest_auth/tests/urls.py similarity index 100% rename from rest_auth/tests/urls.py rename to dj_rest_auth/tests/urls.py diff --git a/rest_auth/urls.py b/dj_rest_auth/urls.py similarity index 100% rename from rest_auth/urls.py rename to dj_rest_auth/urls.py diff --git a/rest_auth/utils.py b/dj_rest_auth/utils.py similarity index 100% rename from rest_auth/utils.py rename to dj_rest_auth/utils.py diff --git a/rest_auth/views.py b/dj_rest_auth/views.py similarity index 100% rename from rest_auth/views.py rename to dj_rest_auth/views.py diff --git a/docs/api_endpoints.rst b/docs/api_endpoints.rst index 46d2a05..a2a4c7d 100644 --- a/docs/api_endpoints.rst +++ b/docs/api_endpoints.rst @@ -72,7 +72,7 @@ Basing on example from installation section :doc:`Installation ` - access_token - code - .. note:: ``access_token`` OR ``code`` can be used as standalone arguments, see https://github.com/Tivix/django-rest-auth/blob/master/rest_auth/registration/views.py + .. note:: ``access_token`` OR ``code`` can be used as standalone arguments, see https://github.com/Tivix/django-rest-auth/blob/master/dj_rest_auth/registration/views.py - /rest-auth/twitter/ (POST) diff --git a/docs/changelog.rst b/docs/changelog.rst index e7beb5d..2bb3f4c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -28,7 +28,7 @@ Changelog 0.9.1 ----- -- fixed import error when extending rest_auth serializers +- fixed import error when extending dj_rest_auth serializers - added sensitive fields decorator - added Spanish translations @@ -109,7 +109,7 @@ Changelog ----- - replaced ``django-registration`` with ``django-allauth`` -- moved registration logic to separated django application (``rest_auth.registration``) +- moved registration logic to separated django application (``dj_rest_auth.registration``) - added serializers customization in django settings - added social media authentication view - changed request method from GET to POST in logout endpoint diff --git a/docs/configuration.rst b/docs/configuration.rst index 59b301f..b988a76 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -6,19 +6,19 @@ Configuration You can define your custom serializers for each endpoint without overriding urls and views by adding ``REST_AUTH_SERIALIZERS`` dictionary in your django settings. Possible key values: - - LOGIN_SERIALIZER - serializer class in ``rest_auth.views.LoginView``, default value ``rest_auth.serializers.LoginSerializer`` + - LOGIN_SERIALIZER - serializer class in ``dj_rest_auth.views.LoginView``, default value ``rest_auth.serializers.LoginSerializer`` - - TOKEN_SERIALIZER - response for successful authentication in ``rest_auth.views.LoginView``, default value ``rest_auth.serializers.TokenSerializer`` + - TOKEN_SERIALIZER - response for successful authentication in ``dj_rest_auth.views.LoginView``, default value ``rest_auth.serializers.TokenSerializer`` - - JWT_SERIALIZER - (Using REST_USE_JWT=True) response for successful authentication in ``rest_auth.views.LoginView``, default value ``rest_auth.serializers.JWTSerializer`` + - JWT_SERIALIZER - (Using REST_USE_JWT=True) response for successful authentication in ``dj_rest_auth.views.LoginView``, default value ``rest_auth.serializers.JWTSerializer`` - - USER_DETAILS_SERIALIZER - serializer class in ``rest_auth.views.UserDetailsView``, default value ``rest_auth.serializers.UserDetailsSerializer`` + - USER_DETAILS_SERIALIZER - serializer class in ``dj_rest_auth.views.UserDetailsView``, default value ``rest_auth.serializers.UserDetailsSerializer`` - - PASSWORD_RESET_SERIALIZER - serializer class in ``rest_auth.views.PasswordResetView``, default value ``rest_auth.serializers.PasswordResetSerializer`` + - PASSWORD_RESET_SERIALIZER - serializer class in ``dj_rest_auth.views.PasswordResetView``, default value ``rest_auth.serializers.PasswordResetSerializer`` - - PASSWORD_RESET_CONFIRM_SERIALIZER - serializer class in ``rest_auth.views.PasswordResetConfirmView``, default value ``rest_auth.serializers.PasswordResetConfirmSerializer`` + - PASSWORD_RESET_CONFIRM_SERIALIZER - serializer class in ``dj_rest_auth.views.PasswordResetConfirmView``, default value ``rest_auth.serializers.PasswordResetConfirmSerializer`` - - PASSWORD_CHANGE_SERIALIZER - serializer class in ``rest_auth.views.PasswordChangeView``, default value ``rest_auth.serializers.PasswordChangeSerializer`` + - PASSWORD_CHANGE_SERIALIZER - serializer class in ``dj_rest_auth.views.PasswordChangeView``, default value ``rest_auth.serializers.PasswordChangeSerializer`` Example configuration: @@ -36,13 +36,13 @@ Configuration You can define your custom serializers for registration endpoint. Possible key values: - - REGISTER_SERIALIZER - serializer class in ``rest_auth.registration.views.RegisterView``, default value ``rest_auth.registration.serializers.RegisterSerializer`` + - REGISTER_SERIALIZER - serializer class in ``dj_rest_auth.registration.views.RegisterView``, default value ``rest_auth.registration.serializers.RegisterSerializer`` .. note:: The custom REGISTER_SERIALIZER must define a ``def save(self, request)`` method that returns a user model instance - **REST_AUTH_TOKEN_MODEL** - model class for tokens, default value ``rest_framework.authtoken.models`` -- **REST_AUTH_TOKEN_CREATOR** - callable to create tokens, default value ``rest_auth.utils.default_create_token``. +- **REST_AUTH_TOKEN_CREATOR** - callable to create tokens, default value ``dj_rest_auth.utils.default_create_token``. - **REST_SESSION_LOGIN** - Enable session login in Login API view (default: True) diff --git a/docs/faq.rst b/docs/faq.rst index d15566a..4a38211 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -3,7 +3,7 @@ FAQ 1. Why account_confirm_email url is defined but it is not usable? - In /rest_auth/registration/urls.py we can find something like this: + In /dj_rest_auth/registration/urls.py we can find something like this: .. code-block:: python @@ -36,12 +36,12 @@ FAQ # custom fields for user company_name = models.CharField(max_length=100) - To allow update user details within one request send to rest_auth.views.UserDetailsView view, create serializer like this: + To allow update user details within one request send to dj_rest_auth.views.UserDetailsView view, create serializer like this: .. code-block:: python from rest_framework import serializers - from rest_auth.serializers import UserDetailsSerializer + from dj_rest_auth.serializers import UserDetailsSerializer class UserSerializer(UserDetailsSerializer): diff --git a/docs/installation.rst b/docs/installation.rst index b382d43..d506727 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -7,7 +7,7 @@ Installation pip install django-rest-auth -2. Add ``rest_auth`` app to INSTALLED_APPS in your django settings.py: +2. Add ``dj_rest_auth`` app to INSTALLED_APPS in your django settings.py: .. code-block:: python @@ -16,19 +16,19 @@ Installation 'rest_framework', 'rest_framework.authtoken', ..., - 'rest_auth' + 'dj_rest_auth' ) .. note:: This project depends on ``django-rest-framework`` library, so install it if you haven't done yet. Make sure also you have installed ``rest_framework`` and ``rest_framework.authtoken`` apps -3. Add rest_auth urls: +3. Add dj_rest_auth urls: .. code-block:: python urlpatterns = [ ..., - url(r'^rest-auth/', include('rest_auth.urls')) + url(r'^rest-auth/', include('dj_rest_auth.urls')) ] 4. Migrate your database @@ -46,7 +46,7 @@ Registration (optional) 1. If you want to enable standard registration process you will need to install ``django-allauth`` by using ``pip install django-rest-auth[with_social]``. -2. Add ``django.contrib.sites``, ``allauth``, ``allauth.account`` and ``rest_auth.registration`` apps to INSTALLED_APPS in your django settings.py: +2. Add ``django.contrib.sites``, ``allauth``, ``allauth.account`` and ``dj_rest_auth.registration`` apps to INSTALLED_APPS in your django settings.py: 3. Add ``SITE_ID = 1`` to your django settings.py @@ -57,19 +57,19 @@ Registration (optional) 'django.contrib.sites', 'allauth', 'allauth.account', - 'rest_auth.registration', + 'dj_rest_auth.registration', ) SITE_ID = 1 -3. Add rest_auth.registration urls: +3. Add dj_rest_auth.registration urls: .. code-block:: python urlpatterns = [ ..., - url(r'^rest-auth/', include('rest_auth.urls')), - url(r'^rest-auth/registration/', include('rest_auth.registration.urls')) + url(r'^rest-auth/', include('dj_rest_auth.urls')), + url(r'^rest-auth/registration/', include('dj_rest_auth.registration.urls')) ] @@ -88,12 +88,12 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati ..., 'rest_framework', 'rest_framework.authtoken', - 'rest_auth' + 'dj_rest_auth' ..., 'django.contrib.sites', 'allauth', 'allauth.account', - 'rest_auth.registration', + 'dj_rest_auth.registration', ..., 'allauth.socialaccount', 'allauth.socialaccount.providers.facebook', @@ -106,12 +106,12 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati Facebook ######## -3. Create new view as a subclass of ``rest_auth.registration.views.SocialLoginView`` with ``FacebookOAuth2Adapter`` adapter as an attribute: +3. Create new view as a subclass of ``dj_rest_auth.registration.views.SocialLoginView`` with ``FacebookOAuth2Adapter`` adapter as an attribute: .. code-block:: python from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter - from rest_auth.registration.views import SocialLoginView + from dj_rest_auth.registration.views import SocialLoginView class FacebookLogin(SocialLoginView): adapter_class = FacebookOAuth2Adapter @@ -131,13 +131,13 @@ Twitter If you are using Twitter for your social authentication, it is a bit different since Twitter uses OAuth 1.0. -3. Create new view as a subclass of ``rest_auth.registration.views.SocialLoginView`` with ``TwitterOAuthAdapter`` adapter and ``TwitterLoginSerializer`` as an attribute: +3. Create new view as a subclass of ``dj_rest_auth.registration.views.SocialLoginView`` with ``TwitterOAuthAdapter`` adapter and ``TwitterLoginSerializer`` as an attribute: .. code-block:: python from allauth.socialaccount.providers.twitter.views import TwitterOAuthAdapter - from rest_auth.registration.views import SocialLoginView - from rest_auth.social_serializers import TwitterLoginSerializer + from dj_rest_auth.registration.views import SocialLoginView + from dj_rest_auth.social_serializers import TwitterLoginSerializer class TwitterLogin(SocialLoginView): serializer_class = TwitterLoginSerializer @@ -160,13 +160,13 @@ GitHub If you are using GitHub for your social authentication, it uses code and not AccessToken directly. -3. Create new view as a subclass of ``rest_auth.views.SocialLoginView`` with ``GitHubOAuth2Adapter`` adapter, an ``OAuth2Client`` and a callback_url as attributes: +3. Create new view as a subclass of ``dj_rest_auth.views.SocialLoginView`` with ``GitHubOAuth2Adapter`` adapter, an ``OAuth2Client`` and a callback_url as attributes: .. code-block:: python from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter from allauth.socialaccount.providers.oauth2.client import OAuth2Client - from rest_auth.registration.views import SocialLoginView + from dj_rest_auth.registration.views import SocialLoginView class GithubLogin(SocialLoginView): adapter_class = GitHubOAuth2Adapter @@ -193,8 +193,8 @@ If you want to allow connecting existing accounts in addition to login, you can from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter from allauth.socialaccount.providers.twitter.views import TwitterOAuthAdapter from allauth.socialaccount.providers.oauth2.client import OAuth2Client - from rest_auth.registration.views import SocialConnectView - from rest_auth.social_serializers import TwitterConnectSerializer + from dj_rest_auth.registration.views import SocialConnectView + from dj_rest_auth.social_serializers import TwitterConnectSerializer class FacebookConnect(SocialConnectView): adapter_class = FacebookOAuth2Adapter @@ -224,7 +224,7 @@ You can also use the following views to check all social accounts attached to th .. code-block:: python - from rest_auth.registration.views import ( + from dj_rest_auth.registration.views import ( SocialAccountListView, SocialAccountDisconnectView ) diff --git a/docs/introduction.rst b/docs/introduction.rst index 191abb5..25cc914 100644 --- a/docs/introduction.rst +++ b/docs/introduction.rst @@ -18,8 +18,8 @@ Features Apps structure -------------- -* ``rest_auth`` has basic auth functionality like login, logout, password reset and password change -* ``rest_auth.registration`` has logic related with registration and social media authentication +* ``dj_rest_auth`` has basic auth functionality like login, logout, password reset and password change +* ``dj_rest_auth.registration`` has logic related with registration and social media authentication Angular app