semvec/pypi-packages huggingface dataset:
django-rest-token-expiry 1.0
Django REST Token Expiry is a Python package designed to add token expiration functionality to Django REST Framework's default token authentication system. This package allows developers to set expiry durations for authentication tokens, enhancing security by automatically invalidating tokens after a specified period.
License: MIT License

# Django REST Token Expiry

Django REST Token Expiry is a Python package designed to add token expiration functionality to Django REST Framework's default token authentication system. This package allows developers to set expiry durations for authentication tokens, enhancing security by automatically invalidating tokens after a specified period.
Installation

You can install Django REST Token Expiry via pip:

```bash
pip install django-rest-token-expiry
```

## Usage
Define `AUTHENTICATION_TOKEN_EXPIRY` in your `settings.py` with the desired time delta value for token expiration:

```python
from datetime import timedelta

AUTHENTICATION_TOKEN_EXPIRY = timedelta(days=7)  # Example: Token expires in 7 days
```

Update the `DEFAULT_AUTHENTICATION_CLASSES` setting in your `REST_FRAMEWORK` settings to include `ExpiringTokenAuthentication`:

```python
REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': [
        'django_rest_token_expiry.authentication.ExpiringTokenAuthentication' # ... other authentication classes
    ]
}
```

Now, the authentication tokens generated by Django REST Framework will have expiration based on the duration specified in `AUTHENTICATION_TOKEN_EXPIRY`.
Contributing

Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request with your changes.
License

This project is licensed under the MIT License - see the LICENSE file for details.
rest-token-expiry 0.0.2
Django REST Token Expiry is a Python package designed to add token expiration functionality to Django REST Framework's default token authentication system. This package allows developers to set expiry durations for authentication tokens, enhancing security by automatically invalidating tokens after a specified period.
License: MIT License

# Django REST Token Expiry

Django REST Token Expiry is a Python package designed to add token expiration functionality to Django REST Framework's default token authentication system. This package allows developers to set expiry durations for authentication tokens, enhancing security by automatically invalidating tokens after a specified period.
Installation

You can install Django REST Token Expiry via pip:

```bash
pip install django-rest-token-expiry
```

## Usage
Define `AUTHENTICATION_TOKEN_EXPIRY` in your `settings.py` with the desired time delta value for token expiration:

```python
from datetime import timedelta

AUTHENTICATION_TOKEN_EXPIRY = timedelta(days=7)  # Example: Token expires in 7 days
```

Update the `DEFAULT_AUTHENTICATION_CLASSES` setting in your `REST_FRAMEWORK` settings to include `ExpiringTokenAuthentication`:

```python
REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': [
        'django_rest_token_expiry.authentication.ExpiringTokenAuthentication' # ... other authentication classes
    ]
}
```

Now, the authentication tokens generated by Django REST Framework will have expiration based on the duration specified in `AUTHENTICATION_TOKEN_EXPIRY`.
Contributing

Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request with your changes.
License

This project is licensed under the MIT License - see the LICENSE file for details.