>
> 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
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
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
3 matches
Mail list logo