Skip to main content

Django auth DB router.

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

Quickstart

  1. Add django_auth_db_router to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'django_auth_db_router',
        ...
    ]
    
  2. Add DATABASE_ROUTERS setting in settings.py file:

    DATABASE_ROUTERS = [
        'django_auth_db_router.routers.AuthRouter',
    ]
    
  3. Add auth_db section to DATABASES:

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': BASE_DIR / 'default.sqlite3',
        },
        'auth_db': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': BASE_DIR / 'auth.sqlite3',
        },
    }
    
  4. Finally, add AUTH_DB setting:

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': BASE_DIR / 'default.sqlite3',
        },
        'auth_db': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': BASE_DIR / 'auth.sqlite3',
        },
    }
    
    AUTH_DB = 'auth_db'
    

    Without this setting router will use default db connection.

Metadata

Release files for django-auth-db-router 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-auth-db-router 1.2.0
File Size Uploaded Provenance Actions
django-auth-db-router-1.2.0.tar.gz 6.0 kB Without provenance Details for django-auth-db-router-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-auth-db-router 1.2.0
File Interpreter ABI Platform Actions
django_auth_db_router-1.2.0-py3-none-any.whl Python 3 none any Details for django_auth_db_router-1.2.0-py3-none-any.whl

Total release size: 13.2 kB

Release files / django-auth-db-router-1.2.0.tar.gz

Download URL django-auth-db-router-1.2.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a7b69373ddc4426dbd689c8374929433a8e5bc1a1a49aaa674a5d851e1ce889c
BLAKE2b-256 checksum
How to use checksums
b74c06c247896bebe52484e00d704b359f52e68476622b85c90768716cc34c9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / django_auth_db_router-1.2.0-py3-none-any.whl

Download URL django_auth_db_router-1.2.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86951a8c97d59db5cf947b0d4ae3fdd77d111e80ac9869b00ae03bbd8097f533
BLAKE2b-256 checksum
How to use checksums
e8b4af5cc5437ae37ba508edd4f4b1f000a1d4d677783b9dbddc3999b923da18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Security for django-auth-db-router 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page