DB-API2 connection pool for Django (for postgresql, mysql and sqlite)
Project description
DB-API2 connection poolling for Django.
Description
Is a simple application that uses the excellent SQLAlchemy connection pool to incorporate a it to django. All work is based on https://github.com/kennethreitz/django-postgrespool/
Note: currently only been tested with postgresql, but in theory it should work perfectly with mysql and sqlite3.
How to install
Run python setup.py install to install, or place djorm_pool on your Python path.
You can also install it with: pip install djorm-ext-pool
How use it?
Very simple, put djorm_pool in your INSTALLED_APPS settings:
# settings.py
INSTALLED_APPS = (
'djorm_pool',
...
)
You can add options to sqlalchemy connection pool adding them in the settings “DJORM_POOL_OPTIONS”.
Example:
DJORM_POOL_OPTIONS = {
"pool_size": 20,
"max_overflow": 0,
"recycle": 3600, # the default value
}
Also, can activate the pessimistic connection handling with DJORM_POOL_PESSIMISTIC:
# With this settings, every checkout of a connection from a pool
# executes an additional query for check the connection state.
DJORM_POOL_PESSIMISTIC = True
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
File details
Details for the file djorm-ext-pool-0.8.1.tar.gz
.
File metadata
- Download URL: djorm-ext-pool-0.8.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1593de32f9563ff40d042cbec77d2fea72939c8b3bc39d6972daadaacbf2c6d8 |
|
MD5 | 71d04c6e4972bf4cc5ce61cd3ed4f4eb |
|
BLAKE2b-256 | eecd13ebd239ee3d23d604ce9b55138c022e92cc1f5f9270b07ca78b261934fe |