when I use the django function object.filter ,the python's handle increased,how can i resolve this?

64 views Asked by At

I use the WIN7 32 System,Django 1.8.13, Python 2.7.

When I use functions like xxx.object.all() or xxx.object.filter('xx'),the python's handle number will increase.

It seems that it used Class QuerySet, then the handle number will increase. Even if,I just use the admin-site to manage the DataBase. The handle leak also will happen.

How can I release it or resolve it ?

1

There are 1 answers

2
user7377795 On

It seems taht I use sqlite3,the handle will not increase.But when i use the mysql 5.6.16,the handles' number will increase. And the Mysql Server was default configuration.

mysql5.5 mysql-python 1.2.5

setting.py:

DATABASES = {
'default':{
    'ENGINE': 'django.db.backends.mysql',
    'NAME':'pcdata',
    'USER': 'root',
    'PASSWORD': 'supcondcs',
    'HOST': '',
    'PORT': '',
}

} enter image description here