Python Forum
upload big file in Django with process bar and i get error : MemoryError
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
upload big file in Django with process bar and i get error : MemoryError
#2
I'm not familiar with Django.

Maybe the print(f.chunks()) causes the MemoryError.
Normally it should not, because the print function does not consume generators.

In the documentation they write, that the method UploadedFile.chunks() should used always.
It the method returns a generator, which is consumed by the for-loop.
The for-loop itself should not cause this issue. For each iteration you get a new chunk
and the old chunk object is garbage collected.

Maybe you overwrite at some other place your settings. Does it work with small uploads?
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: upload big file in Django with process bar and i get error : MemoryError - by DeaD_EyE - Aug-05-2019, 05:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python django view error ZeeKolachi 1 414 Mar-18-2024, 03:14 PM
Last Post: Sowmya
Photo After using models.Model on my class Im getting 'ImproperlyConfigured' error Django khavro 1 2,217 Apr-05-2021, 03:11 PM
Last Post: SheeppOSU
  Error - ManyToMany Fields in Django rob25111 0 1,557 Jan-17-2021, 04:58 PM
Last Post: rob25111
  creating an exe file for a python django project Sanjish 0 2,638 Dec-27-2020, 07:33 AM
Last Post: Sanjish
  Upload big file on the server HTTP protocol Timych 1 2,442 May-15-2020, 07:12 AM
Last Post: snippsat
  [Django] css file is not applying to the page SheeppOSU 1 3,106 May-09-2020, 06:54 AM
Last Post: menator01
  fix error upload image in python abdlwafitahiri 1 2,393 Jan-05-2020, 08:49 AM
Last Post: Larz60+
  Django Python Vscode Error Please Help Smhbugra 3 2,759 Jun-30-2019, 10:54 AM
Last Post: noisefloor
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,354 Jun-30-2019, 12:21 AM
Last Post: scidam
  Django Connection Error erfanakbari1 1 2,625 Mar-21-2019, 08:09 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020