Skip to main content

D

快速开始

自动注册模型到Admin

setting.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'DjangoDynamicDrive.dynamic',
    # 你的APP
    'testapp',
]

数据库路由,指定Django app 使用所选择的数据库

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'default',
        'USER': '你的账户',
        'PASSWORD': '你的密码',
        'HOST': '数据库的IP或者host',
        'PORT': '数据库服务开放的端口',
    },
    'logsdb': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'logs',
        'USER': '你的账户',
        'PASSWORD': '你的密码',
        'HOST': '数据库的IP或者host',
        'PORT': '数据库服务开放的端口',
    }
}

# 数据库路由
DATABASE_ROUTERS = ['DjangoDynamicDrive.db.database_router.DatabaseAppsRouter']
# 应用与数据库映射
DATABASE_APPS_MAPPING = {
    'testapp': 'logsdb',
    # app名称:数据库路由
}

数据库迁移

python manage.py makemigrations
python manage.py migrate --database=logsdb

Metadata

Release files for DjangoDynamicDrive 0.0.4

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

Source distribution (sdist)

Source distribution for DjangoDynamicDrive 0.0.4
File Size Uploaded Provenance
djangodynamicdrive-0.0.4.tar.gz 5.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for DjangoDynamicDrive 0.0.4
File Interpreter ABI Platform
djangodynamicdrive-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / djangodynamicdrive-0.0.4.tar.gz

Download URL djangodynamicdrive-0.0.4.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7177b8c5b3ebe7769f8ddf75abbe602280ac864fd89783b26b3d099e09d8c9ba
BLAKE2b-256 checksum
How to use checksums
219ba15ab65af2c9a3e570563e396d0c52643e86e307886678ba0bd699f5a1e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / djangodynamicdrive-0.0.4-py3-none-any.whl

Download URL djangodynamicdrive-0.0.4-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f9f6201e53edb39582aae8e07b76f9b02afe9feb4de6ef9ba4daaa8afd2c72a
BLAKE2b-256 checksum
How to use checksums
e0f796e061f839aa849353956653a24320cbd0afa51ab3df95d38913aee2c83c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Security for DjangoDynamicDrive 0.0.4

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.

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