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
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 djangodynamicdrive-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f9f6201e53edb39582aae8e07b76f9b02afe9feb4de6ef9ba4daaa8afd2c72a |
|
MD5 | fb8696ee3e25883c94e55f43c5bd85b5 |
|
BLAKE2b-256 | e0f796e061f839aa849353956653a24320cbd0afa51ab3df95d38913aee2c83c |