Add a MySQL connection pool for django using gevent
Project description
# django-mysql-geventpool
[![CircleCI](https://circleci.com/gh/shunsukeaihara/django-mysql-geventpool/tree/master.svg?style=svg)](https://circleci.com/gh/shunsukeaihara/django-mysql-geventpool/tree/master)
Mysql Connection Pooling backend for Django 2.0+ using gevent, only supports Python 3.4 or newer.
It works with gunicorn async worker via gevent.
This implimentation is based on django-db-geventpool(https://github.com/jneight/django-db-geventpool).
## install
```
pip install django-mysql-geventpool
```
## Settings
Add the 'django_mysql_geventpool' modules to the INSTALLED_APPS like this:
```
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_mysql_geventpool',
# ...other installed applications...
)
```
Add MAX_CONNS to OPTIONS to set the maximun number of connections allowed to database (default=4)
```
DATABASES = {
'default': {
'ENGINE': 'django_mysql_geventpool.backends.mysql',
'NAME': 'dbname',
'USER': 'dbuser',
'PASSWORD': 'dbpassword',
'HOST': 'dbhost',
'PORT': 'dbport',
'OPTIONS': {
'MAX_CONNS': 20
}
}
}
```
[![CircleCI](https://circleci.com/gh/shunsukeaihara/django-mysql-geventpool/tree/master.svg?style=svg)](https://circleci.com/gh/shunsukeaihara/django-mysql-geventpool/tree/master)
Mysql Connection Pooling backend for Django 2.0+ using gevent, only supports Python 3.4 or newer.
It works with gunicorn async worker via gevent.
This implimentation is based on django-db-geventpool(https://github.com/jneight/django-db-geventpool).
## install
```
pip install django-mysql-geventpool
```
## Settings
Add the 'django_mysql_geventpool' modules to the INSTALLED_APPS like this:
```
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_mysql_geventpool',
# ...other installed applications...
)
```
Add MAX_CONNS to OPTIONS to set the maximun number of connections allowed to database (default=4)
```
DATABASES = {
'default': {
'ENGINE': 'django_mysql_geventpool.backends.mysql',
'NAME': 'dbname',
'USER': 'dbuser',
'PASSWORD': 'dbpassword',
'HOST': 'dbhost',
'PORT': 'dbport',
'OPTIONS': {
'MAX_CONNS': 20
}
}
}
```
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
Close
Hashes for django-mysql-geventpool-0.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d711428aa179bb57f42609782e8df80453c0f4a797df49c201198db591395d0 |
|
MD5 | 41dee35cd214f079ed149c9161f1daa2 |
|
BLAKE2b-256 | e6004729e5c5aa5b70402bf86c2b799e929e4b1010f336a02f65c3adf21e19ed |