Skip to main content

store Django Static Files on Amazon S3

Project description

Installation

$ [sudo] pip install django-s3-static

settings.py

INSTALLED_APPS = [
    "django_s3_static",
]

AWS_STATIC_BUCKET_NAME = "<name>"
AWS_STATIC_DOMAIN = '%s.s3.amazonaws.com' % AWS_STATIC_BUCKET_NAME
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = "https://%s/" % AWS_STATIC_DOMAIN
{% load static %}
<link rel="stylesheet" href="{% static "css/file.css" %}">

Examples

$ python manage.py s3-static-create # create s3 bucket and policy
$ python manage.py s3-static-sync   # sync static folder with s3 bucket

readme-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-s3-static-2019.3.16.tar.gz (1.4 kB view hashes)

Uploaded Source

Built Distribution

django_s3_static-2019.3.16-py2.py3-none-any.whl (2.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page