Metadata-Version: 2.1
Name: dj-ms-auth-router
Version: 1.0.0
Summary: Simple database router that helps to implement microservices architecture with Django.
Home-page: https://github.com/dj-ms/dj-ms-auth-router
Author: Astafeev Rustam
Author-email: astafeev0308@gmail.com
License: BSD-3-Clause
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.1
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: ~=3.10
Description-Content-Type: text/markdown
License-File: LICENSE

# Django microservice auth SDK

# Django auth DB router.

Simple database router that helps to split your main database and authentication database.
This may be necessary when splitting a project into microservices.

---


## Quickstart

Add `ms_auth_router` to your `INSTALLED_APPS` setting like this:
```python
INSTALLED_APPS = [
    ...,
    'ms_auth_router',
    ...
]
```

Add `DATABASE_ROUTERS` setting in `settings.py` file or append to existing list:
```python
DATABASE_ROUTERS = [
    'ms_auth_router.routers.DefaultRouter',
    ...
]
```

Add `auth_db` section to `DATABASES`:
```pycon
DATABASES = {
   ...
   'auth_db': {
       'ENGINE': 'django.db.backends.sqlite3',
       'NAME': BASE_DIR / 'auth.sqlite3',
   },
   ...
}
```

Finally, add `AUTH_DB` setting:
```python
AUTH_DB = 'auth_db'
```

Without this setting router will use `default` db connection.
