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

Commands

command help
python manage.py s3-static-create create s3 bucket and policy
python manage.py s3-static-sync sync static directory with s3 bucket

Examples

$ python manage.py s3-static-create # create s3 bucket and policy
$ python manage.py s3-static-sync   # sync static folder with s3 bucket
{% load static %}
<link rel="stylesheet" href="{% static "css/file.css" %}">

django-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.4.13.tar.gz (1.6 kB view details)

Uploaded Source

File details

Details for the file django-s3-static-2019.4.13.tar.gz.

File metadata

  • Download URL: django-s3-static-2019.4.13.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2

File hashes

Hashes for django-s3-static-2019.4.13.tar.gz
Algorithm Hash digest
SHA256 15b6a74b35a735b6b7570282f61cc443004354e440c6c0a849f83c21d6f559b4
MD5 b0e847ab715fcf2a1378497f43680398
BLAKE2b-256 b3e5d8b7273f972dddd825e727538aea81078b7e216dbb1b10df8cde17f85a22

See more details on using hashes here.

Supported by

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