Repository: cookiecutter/cookiecutter-django

Issue:
storages with S3 doesn't work without DEFAULT_FILE_STORAGE setting
Every time I deploy a new app to Heroku, I always forget how much trouble I have getting S3 to work correctly using the default settings from cookiecutter.  Unless I just missed something in the docs, production settings seem to be missing the DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' setting.  I have not been able to get storages to work with S3 without it.  

Is there a reason this isn't in the production settings file by default?
Modify 'django-storages-redux' to 'django-storages', and 'boto' to 'boto3', in production.txt requirements file.
Correct me if I'm wrong but I believe the 'https://github.com/jschneier/django-storages' repo is the official successor of the django-storages-redux project as of February 2016 per its documentation. It recommends using the boto3 backend instead of the older boto backend https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html.

Sorry in advance if I've missed anything. Thanks.


Discussion:

This might resolve #1050 

After I upgraded to storages and boto3, changing all imports from *boto* to *boto3* and changed the settings to follow the new storages settings I'm finally no longer getting ImportError boto again.
Thanks. Yes [django-storages](https://github.com/jschneier/django-storages) is awesome.

Resolving patch:
diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py
--- a/{{cookiecutter.project_slug}}/config/settings/production.py
+++ b/{{cookiecutter.project_slug}}/config/settings/production.py
@@ -1,7 +1,9 @@
 """
 Production Configurations
 
-- Use Amazon's S3 for storing static files and uploaded media
+{% if cookiecutter.use_whitenoise == 'y' -%}
+- Use WhiteNoise for serving static files{% endif %}
+- Use Amazon's S3 for {% if cookiecutter.use_whitenoise == 'n' -%}storing static files {% endif %}and uploaded media
 - Use mailgun to send emails
 - Use Redis for cache
 {% if cookiecutter.use_sentry_for_error_reporting == 'y' %}
@@ -12,7 +14,6 @@
 {% endif %}
 """
 
-from boto.s3.connection import OrdinaryCallingFormat
 {% if cookiecutter.use_sentry_for_error_reporting == 'y' %}
 import logging
 {% endif %}
@@ -98,7 +99,6 @@
 AWS_STORAGE_BUCKET_NAME = env('DJANGO_AWS_STORAGE_BUCKET_NAME')
 AWS_AUTO_CREATE_BUCKET = True
 AWS_QUERYSTRING_AUTH = False
-AWS_S3_CALLING_FORMAT = OrdinaryCallingFormat()
 
 # AWS cache settings, don't change unless you know what you're doing:
 AWS_EXPIRY = 60 * 60 * 24 * 7
@@ -115,11 +115,12 @@
 # stored files.
 {% if cookiecutter.use_whitenoise == 'y' -%}
 MEDIA_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME
+DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
 {% else %}
 #  See:http://stackoverflow.com/questions/10390244/
-from storages.backends.s3boto import S3BotoStorage
-StaticRootS3BotoStorage = lambda: S3BotoStorage(location='static')
-MediaRootS3BotoStorage = lambda: S3BotoStorage(location='media')
+from storages.backends.s3boto3 import S3Boto3Storage
+StaticRootS3BotoStorage = lambda: S3Boto3Storage(location='static')
+MediaRootS3BotoStorage = lambda: S3Boto3Storage(location='media')
 DEFAULT_FILE_STORAGE = 'config.settings.production.MediaRootS3BotoStorage'
 
 MEDIA_URL = 'https://s3.amazonaws.com/%s/media/' % AWS_STORAGE_BUCKET_NAME
@@ -141,7 +142,7 @@
 {% if cookiecutter.use_compressor == 'y'-%}
 # COMPRESSOR
 # ------------------------------------------------------------------------------
-COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
+COMPRESS_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
 COMPRESS_URL = STATIC_URL
 COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True)
 {%- endif %}


Test patch: