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" %}">
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-s3-static-2019.4.13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15b6a74b35a735b6b7570282f61cc443004354e440c6c0a849f83c21d6f559b4 |
|
MD5 | b0e847ab715fcf2a1378497f43680398 |
|
BLAKE2b-256 | b3e5d8b7273f972dddd825e727538aea81078b7e216dbb1b10df8cde17f85a22 |