how to serve local static files in development when hosted in S3
<p>I'm storing my static files in S3 according to this tutorial:  <a href="https://www.caktusgroup.com/blog/2014/11/10/Using-Amazon-S3-to-store-your-Django-sites-static-and-media-files/" rel="nofollow">https://www.caktusgroup.com/blog/2014/11/10/Using-Amazon-S3-to-store-your-Django-sites-static-and-media-files/</a></p>

<p>I am developing a lot of javascript and want to serve my javascript files locally only when in my development environment. Otherwise I would have to keep uploading my js files every time I want to test.</p>

<p>My static files settings look like this currently:</p>

<pre><code>STATICFILES_LOCATION = 'static'
STATICFILES_STORAGE = 'my.custom_storage.StaticStorage'
STATIC_URL = "https://%s/%s/" % (AWS_S3_CUSTOM_DOMAIN, STATICFILES_LOCATION)
</code></pre>

<p>I created a local_settings.py file with setttings that point locally:</p>

<pre><code>STATICFILES_LOCATION = '/local/myapp/common/static/'
STATICFILES_STORAGE = ''
STATIC_URL = '/static/'
STATIC_ROOT = "/local/myapp/common/static/"
</code></pre>

<p>No matter what I change here, my app looks for the js files at the S3 url:  <a href="http://s3.amazonaws.com" rel="nofollow">http://s3.amazonaws.com</a>...</p>

<p><strong>How can I have my app look locally for static files when in development so I can rapidly test my js files?</strong></p>

<p>I set the following in my local_settings.py:</p>

<pre><code>STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
</code></pre>

<p>Then it looks for all static assets at localhost.</p>

javascript python django amazon-s3 django-staticfiles