{% 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