Django myslq backend that fixes issue with long living connection
Project description
基于下面库进行优化,主要适配Django==5.0.3以后的版本。修复原子事务报错的问题
安装:pip install mysql_server_has_gone
因为代码里用到了MySQLdb库,所以需要安装mysqlclient。如果你用到了其他库导致报错,可以github上滴滴我,我会及时修复的。
以下是原始文档:
MySQL-server-has-gone-away
This repository solves issue where database connection inside of django overlives MySQL database connection timeout specified in /etc/my.cnf
wait_timeout = xxxx
. See this issue
How to use:
-
For Django 1.x and 2.x use
pip install mysql_server_has_gone_away==1.0.0
-
For django 3.x use
pip install mysql_server_has_gone==2.0.0
-
Put this engine into Django
settings.py
:
DATABASES = {
'default': {
'ENGINE': 'mysql_server_has_gone_away',
#'NAME': 'database-name',
#'USER': 'database-user',
#'PASSWORD': 'database-password',
#'HOST': 'localhost',
}
}
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
Built Distribution
Close
Hashes for mysql_server_has_gone-2.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a1b83b653c9d0c8e0f52d9636faf77280f29b6d1e759d964238285072c51fc7 |
|
MD5 | d05b5ececab511ab3864109f767ae980 |
|
BLAKE2b-256 | ab229e2557275559554d15f5c66cf8a0b35bd49cce4d736e539b1b52da97f142 |
Close
Hashes for mysql_server_has_gone-2.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 685fb3d5e1e58bf6d0e92de1f047c9d669b3c3cfff54731667545358c5ba5e5e |
|
MD5 | 948a410756929119d71efd1d44494032 |
|
BLAKE2b-256 | bec01e0a966fc47036edd11ce8cd54ac3f51f171a1879db56661315d120ca457 |