Metadata-Version: 2.1
Name: django-rest-registration
Version: 0.9.0
Summary: User registration REST API, based on django-rest-framework
Author-email: Andrzej Pragacz <apragacz@o2.pl>
License: The MIT License (MIT)
        
        Copyright (c) 2015-2024 Andrzej Pragacz
        
        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.
        
        
Project-URL: homepage, https://github.com/apragacz/django-rest-registration
Project-URL: Bug Tracker, https://github.com/apragacz/django-rest-registration/issues
Project-URL: Documentation, https://django-rest-registration.readthedocs.io/
Project-URL: Source Code, https://github.com/apragacz/django-rest-registration
Keywords: django,rest,api,auth,rest-framework,registration,register,login,reset-password,register-email,change-email,sign-up,sign-in
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 2.0
Classifier: Framework :: Django :: 3.0
Classifier: Framework :: Django :: 4.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Internet
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=2.0
Requires-Dist: djangorestframework>=3.3

# Django REST Registration

[![CircleCI Build Status](https://circleci.com/gh/apragacz/django-rest-registration.svg?style=shield)](https://circleci.com/gh/apragacz/django-rest-registration)
[![Codecov Coverage](https://codecov.io/gh/apragacz/django-rest-registration/branch/master/graphs/badge.svg?branch=master)](https://codecov.io/github/apragacz/django-rest-registration?branch=master)
[![PyPi Version](https://badge.fury.io/py/django-rest-registration.svg)](https://pypi.python.org/pypi/django-rest-registration/)
[![Documentation Status](https://readthedocs.org/projects/django-rest-registration/badge/?version=latest)](https://django-rest-registration.readthedocs.io/en/latest/?badge=latest)

User registration REST API, based on Django REST Framework.

## Documentation

Full documentation for the project is available at [https://django-rest-registration.readthedocs.io/](https://django-rest-registration.readthedocs.io/).

## Requirements

* Django (2.0+, 3.0+, 4.0+, 5.0+) and Django-REST-Framework (3.3+)
* Python 3.7 or higher (no Python 2 support!)

## Features

* Supported views:
    * registration (sign-up) with verification
    * login/logout (sign-in), session- or token-based
    * user profile (retrieving / updating)
    * reset password
    * change password
    * register (change) e-mail
* Views are compatible with [django-rest-swagger](https://github.com/marcgibbons/django-rest-swagger)
* Views can be authenticated via session or auth token
* Modeless (uses the user defined by `settings.AUTH_USER_MODEL` and also uses [cryptographic signing](https://docs.djangoproject.com/en/dev/topics/signing/) instead of profile models)
* Uses [password validation](https://docs.djangoproject.com/en/dev/topics/auth/passwords/#password-validation)
* Heavily tested (Above 98% code coverage)


## Current limitations

*   Supports only one email per user (as model field)
*   No JWT support (but you can easily
    [implement one](https://django-rest-registration.readthedocs.io/en/latest/cookbook/jwt.html)
    or use Django REST Registration along libraries like
    [django-rest-framework-simplejwt](https://github.com/davesque/django-rest-framework-simplejwt))


## Installation & Configuration

You can [install](https://django-rest-registration.readthedocs.io/en/latest/install.html)
Django REST Registration latest version via pip:

    pip install django-rest-registration

Then, you should add it to the `INSTALLED_APPS` so the app templates
for notification emails can be accessed:

```python
INSTALLED_APPS=(
    ...

    'rest_registration',
)
```
After that, you can use the urls in your urlconfig, for instance:

```python
api_urlpatterns = [
    ...

    path('accounts/', include('rest_registration.api.urls')),
]


urlpatterns = [
    ...

    path('api/v1/', include(api_urlpatterns)),
]
```

You can configure Django REST Registration using the `REST_REGISTRATION`
setting in your Django settings (similarly to Django REST Framework).

Below is sample, minimal config you can provide in your django settings which will satisfy the system checks:

```python
REST_REGISTRATION = {
    'REGISTER_VERIFICATION_ENABLED': False,
    'RESET_PASSWORD_VERIFICATION_ENABLED': False,
    'REGISTER_EMAIL_VERIFICATION_ENABLED': False,
}
```

However, the preferred base configuration would be:

```python
REST_REGISTRATION = {
    'REGISTER_VERIFICATION_URL': 'https://frontend-host/verify-user/',
    'RESET_PASSWORD_VERIFICATION_URL': 'https://frontend-host/reset-password/',
    'REGISTER_EMAIL_VERIFICATION_URL': 'https://frontend-host/verify-email/',

    'VERIFICATION_FROM_EMAIL': 'no-reply@example.com',
}
```

The frontend urls are not provided by the library but should be provided
by the user of the library, because Django REST Registration is frontend-agnostic.
The frontend urls will receive parameters as GET query and should pass
them to corresponding REST API views via HTTP POST request.

In case when any verification is enabled (which is the default!),
your Django application needs to be
[properly configured so it can send e-mails](https://docs.djangoproject.com/en/dev/topics/email/).

You can read more about basic configuration
[here](https://django-rest-registration.readthedocs.io/en/latest/quickstart.html).

You can read more about detailed configuration
[here](https://django-rest-registration.readthedocs.io/en/latest/detailed_configuration/).

## Configuration options

You can find all `REST_REGISTRATION` configuration options
[here](https://django-rest-registration.readthedocs.io/en/latest/detailed_configuration/all_settings.html).

## Contributing

If you want to contribute, please refer to separate document [CONTRIBUTING.md](CONTRIBUTING.md).
