Re: Long-running process using Django ORM maxes out psql connections

2014-09-11 Thread Paco de Kumite
> > This may not be the cleanest, but it works: > First make a decorator, like this: import django.db from functools import wraps def close_dbconn(func): @wraps(func) def close_dbconn_func(*args, **kwargs): func(*args,**kwargs) django.db.close_old_connections() return close_dbconn_func Then a

Long-running process using Django ORM maxes out psql connections

2014-09-11 Thread Paco de Kumite
Hello. I have a standalone script that is long-running (i.e is supposed to run in a loop forever). This script uses the Django ORM for work on a database. For example, every two seconds it does a MyModel.objects.all(). Works awesome, but after a while I get OperationalError: FATAL: remainin

Email makes it to Gmail, but not Squirrelmail

2012-12-03 Thread Paco de Kumite
Hi. I have a little view that sends an email. I looks like this msg = EmailMultiAlternatives(subject, text_content, from_email, [to]) msg.attach_alternative(html_content, "text/html") msg.send() where text_content is a simple text message and html_content is, well, some html content. The html