<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Django on Shaun Chuah</title>
    <link>https://shaunchuah.github.io/tags/django/</link>
    <description>Recent content in Django on Shaun Chuah</description>
    <image>
      <title>Shaun Chuah</title>
      <url>https://shaunchuah.github.io/profile_photo.jpg</url>
      <link>https://shaunchuah.github.io/profile_photo.jpg</link>
    </image>
    <generator>Hugo -- 0.151.0</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 10 Dec 2023 18:59:15 +0000</lastBuildDate>
    <atom:link href="https://shaunchuah.github.io/tags/django/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to Handle Big Data Uploads in Django</title>
      <link>https://shaunchuah.github.io/posts/how-to-handle-big-data-uploads-in-django/</link>
      <pubDate>Sun, 10 Dec 2023 18:59:15 +0000</pubDate>
      <guid>https://shaunchuah.github.io/posts/how-to-handle-big-data-uploads-in-django/</guid>
      <description>&lt;h2 id=&#34;traditional-file-uploads-in-django&#34;&gt;Traditional File Uploads in Django&lt;/h2&gt;
&lt;p&gt;Handling non-trivial big data file uploads (think &amp;gt;5gb/file) in Django can be challenging. A typical file upload storage strategy in Django is to use django-storages and an Amazon S3 backend. In the traditional way, your browser uploads the file directly to Django which then transmits the data to S3.&lt;/p&gt;
&lt;p&gt;This creates two problems:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Django needs to have enough memory to hold your uploaded file for retransmission.&lt;/li&gt;
&lt;li&gt;The Django worker receiving the file upload is blocked until the upload is finished.&lt;/li&gt;
&lt;li&gt;Streaming the upload onwards to S3 doubles the amount of bandwidth used.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;what-if-we-could-instead-upload-directly-into-aws-s3-while-registering-the-upload-with-django&#34;&gt;What if we could instead upload directly into AWS S3 while registering the upload with Django?&lt;/h2&gt;
&lt;p&gt;I stumbled across this excellent article by Radoslav Georgiev of HackSoft: &lt;a href=&#34;https://www.hacksoft.io/blog/direct-to-s3-file-upload-with-django&#34;&gt;https://www.hacksoft.io/blog/direct-to-s3-file-upload-with-django&lt;/a&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
