/publishstatic

Django management command to publish static files

Primary LanguagePythonOtherNOASSERTION

publishstatic command

Install

    pip install publishstatic

Setup

Add publishstatic to INSTALLED_APPS:

    INSTALLED_APPS = [
        ...
        'publishstatic',
    ]

Ensure the storage engine is set to use ManifestStaticFilesStoarge in settings.py

    STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'

Set you bucket/subdirectory name if needed.

    PUBLISH_BUCKET_NAME = 'tracktor'
    PUBLISH_STORAGE_ENGINE = 's3'  # or 'local' for testing

Run the shell command to collect static. Then publish!

    ./manage.py collectstatic
    ./manage.py publishstatic

That is it!