Skip to main content

Django Rapid Development Assistant Tool

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangodynamicdrive-0.0.4.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djangodynamicdrive-0.0.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file djangodynamicdrive-0.0.4.tar.gz.

File metadata

  • Download URL: djangodynamicdrive-0.0.4.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for djangodynamicdrive-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7177b8c5b3ebe7769f8ddf75abbe602280ac864fd89783b26b3d099e09d8c9ba
MD5 8bd741ff926f8348a870bc0354d05966
BLAKE2b-256 219ba15ab65af2c9a3e570563e396d0c52643e86e307886678ba0bd699f5a1e5

See more details on using hashes here.

File details

Details for the file djangodynamicdrive-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for djangodynamicdrive-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4f9f6201e53edb39582aae8e07b76f9b02afe9feb4de6ef9ba4daaa8afd2c72a
MD5 fb8696ee3e25883c94e55f43c5bd85b5
BLAKE2b-256 e0f796e061f839aa849353956653a24320cbd0afa51ab3df95d38913aee2c83c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page