معرفی شرکت ها


dj-ms-auth-router-1.5.1


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Simple database router that helps to implement microservices architecture with Django.
ویژگی مقدار
سیستم عامل -
نام فایل dj-ms-auth-router-1.5.1
نام dj-ms-auth-router
نسخه کتابخانه 1.5.1
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Astafeev Rustam
ایمیل نویسنده astafeev0308@gmail.com
آدرس صفحه اصلی https://github.com/dj-ms/dj-ms-auth-router
آدرس اینترنتی https://pypi.org/project/dj-ms-auth-router/
مجوز BSD-3-Clause
# 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. Let's say you have some Django project and want to split it into microservices. But all of your microservices need to use the same authentication database. This router will help you to do that. --- ## How it works 1. Django project that provides authentication also shares default database with other microservices. 2. Other microservices may have their own databases, but they all use the same authentication database. Which apps are routed to `auth_db` database? - `contenttypes` - `sites` - `auth` - `admin` - `flatpages` - `redirects` - `auditlog` - `sessions` Models of these apps are routed to `auth_db` database. These apps are hardcoded in `ms_auth_router.routers.DefaultRouter`. List can be extended by adding `ROUTE_APP_LABELS` setting. > If you know that some reusable Django apps should be routed to `auth_db` database, please create an issue or pull request. ## 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. > Note: To get session authentication working between microservices, the `SECRET_KEY` setting must be the same > in all microservices. ## Use with custom auth app If you're using custom auth app and want it to be routed to `auth_db` database, you need to add `ROUTE_APP_LABELS` setting: ```python ROUTE_APP_LABELS = ['my_custom_auth_app', ] ```


نیازمندی

مقدار نام
>=3.1 Django


زبان مورد نیاز

مقدار نام
~=3.8 Python


نحوه نصب


نصب پکیج whl dj-ms-auth-router-1.5.1:

    pip install dj-ms-auth-router-1.5.1.whl


نصب پکیج tar.gz dj-ms-auth-router-1.5.1:

    pip install dj-ms-auth-router-1.5.1.tar.gz