Heroku Collectstatic Timeout with Django App

With an unexpected problem, when my last attempts to run collectstatic for an application on Heroku are played out endlessly:

Running `python manage.py collectstatic` attached to terminal... up, run.6250
/app/.heroku/python/lib/python2.7/site-packages/dotenv.py:16: UserWarning: not reading .env -   it doesn't exist.
warnings.warn("not reading %s - it doesn't exist." % dotenv)

You have requested to collect static files at the destination
location as specified in your settings.

This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes

After entering "yes", it freezes and time without errors. The same thing happens when I add --dry-run --noinput. My env.txt files include

AWS_ACCESS_KEY
AWS_SECRET_ACCESS_KEY
AWS_QUERYSTRING_AUTH = False

I am puzzled that nothing has changed in my code, and I have previously successfully run the build with this application.

The application uses the use of django storage for S3-boto. Here are my settings:

if DEBUG:
    #dev storage using local
    ...

else:
    # Production AWS S3    
    STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
    DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
    AVATAR_STORAGE_DIR = 'avatars/'

    AWS_ACCESS_KEY_ID = env('AWS_ACCESS_KEY_ID')
    AWS_SECRET_ACCESS_KEY = env('AWS_SECRET_ACCESS_KEY')
    AWS_STORAGE_BUCKET_NAME = env('AWS_STORAGE_BUCKET_NAME')
    AWS_QUERYSTRING_AUTH = env('AWS_QUERYSTRING_AUTH', False)
    AWS_PRELOAD_METADATA = True

    STATIC_URL = 'http://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
    MEDIA_URL = STATIC_URL
    ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'

All AWS credentials are configured in the Heroku configuration. FWIW I have

heroku labs:enable user-env-compile 

switched on

+3
source share
1 answer

collectfast requirements.txt settings.py( ). , , , . Django ( Heroku, ).

0

All Articles