Django OperationalError: could not fork new process for connection

前端 未结 1 494
Happy的楠姐
Happy的楠姐 2021-01-05 20:39

I\'ve started getting this error on the production environment this morning, after getting Django-storages, Boto, and Django-compressor working to put static files on S3 yes

1条回答
  •  孤街浪徒
    2021-01-05 21:36

    I encountered the same problem trying to set up a simple django web application with a postgresql database on heroku and managed to solve it.

    I don't fully understand the error but the fix is fairly simple: when you are passing python lists created by queries to your database, you need to limit the size of the list.

    So for example if you are passing as context the following list:

    set_list = userSetTable.objects.all()

    return render(request, 'fc/user.html', {'set_list': set_list,})

    That will cause an error because set_list might be really big. You need to specify a maximum size:

    set_list = userSetTable.objects.all()[0:20]
    

    So in a real-world application, you might want to display the list as page results or whatever... you get the point.

    0 讨论(0)
提交回复
热议问题