Oll*_*ass 1 mysql compression django database-connection
我的 MySQL 服务器上有压缩,我想确保 Django 正在建立压缩连接。我怎样才能做到这一点?
试验、错误和推理表明解决方案是在字典中使用compress设置为的字段:TrueOPTIONS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
...
'OPTIONS': {
'compress': True
}
}
}
Run Code Online (Sandbox Code Playgroud)
但我无法确认连接实际上已被压缩。
| 归档时间: |
|
| 查看次数: |
760 次 |
| 最近记录: |