Simple database router that helps to implement microservices architecture with Django.
Project description
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:
INSTALLED_APPS = [
...,
'ms_auth_router',
...
]
Add DATABASE_ROUTERS
setting in settings.py
file or append to existing list:
DATABASE_ROUTERS = [
'ms_auth_router.routers.DefaultRouter',
...
]
Add auth_db
section to DATABASES
:
DATABASES = {
...
'auth_db': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'auth.sqlite3',
},
...
}
Finally, add AUTH_DB
setting:
AUTH_DB = 'auth_db'
Without this setting router will use default
db connection.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for dj_ms_auth_router-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99e7ac712cb7d8deef70e92f59b282b0e2d364b4d2d4aa8f038060ef6c9740c2 |
|
MD5 | 093dc95a064bf90316f36e7f2586cb83 |
|
BLAKE2b-256 | ee10838e9961f841c7cc48e9c7b405ca182830a0499c2f4b5dbae2b4cc9fcca9 |