通过DBUtils库实现Django数据库连接池,目前支持mysql、postgresql 数据库.
下面的配置参考:
DATABASES = {
'default':{
'ENGINE': 'djdbpool.db.backends.mysql',
"HOST": "127.0.0.1",
"NAME": "test_db",
"PASSWORD": "",
"USER": "django",
"PORT": 3306,
'OPTIONS': {'charset': 'utf8mb4'},
'POOL': { # 更多的配置请参考DBUtils的配置
'minsize': 5, # 初始化时,连接池中至少创建的空闲的链接,0表示不创建,不填默认为5
'maxsize': 10, # 连接池中最多闲置的链接,0不限制,不填默认为0
'maxconnections': 60, # 连接池允许的最大连接数,0表示不限制连接数, 默认为0
'blocking': True, # 连接池中如果没有可用连接后,是否阻塞等待。True:等待;False:不等待然后报错, 默认False
'ping':0 # 检查服务是否可用 1检查0不检查
}
}
}
Metadata
Release files for django-database-pool 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-database-pool-0.0.3.tar.gz | 4.3 kB | Without provenance | Details |
Release files / django-database-pool-0.0.3.tar.gz
| Download URL | django-database-pool-0.0.3.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1cfa10e2523a0215be8a1c7a4c905f1818021a511ea232bf336fa2965901937f
|
|
BLAKE2b-256 checksum How to use checksums |
ea957098930af417ca54c5c0e8cc8ca9fbe98cc013c9633fad3947c603baf10e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/44.1.1 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.10
|
Security for django-database-pool 0.0.3
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.