sometimes on my site when I'm working on my local version, I get this error in my console :
error: [Errno 32] Broken pipe
Does anyone have an idea to where it come from and how to prevent this because it's slowing down the site a lot.
sometimes on my site when I'm working on my local version, I get this error in my console :
error: [Errno 32] Broken pipe
Does anyone have an idea to where it come from and how to prevent this because it's slowing down the site a lot.
I got this when the database connection was hanging between dev server and db (using Amazon RDS).
This might be because you are using two method for inserting data into database and this cause the site to slow down.
def add_subscriber(request, email=None):
if request.method == 'POST':
email = request.POST['email_field']
e = Subscriber.objects.create(email=email).save() <====
return HttpResponseRedirect('/')
else:
return HttpResponseRedirect('/')
eg. in above function error is where arrow is pointing the correct way to implement above is
def add_subscriber(request, email=None):
if request.method == 'POST':
email = request.POST['email_field']
e = Subscriber.objects.create(email=email)
return HttpResponseRedirect('/')
else:
return HttpResponseRedirect('/')