Skip to main content
https://badge.fury.io/py/dj-libcloud.png

Adds easy python 3 and 2.7 support to Django for management of static assets. This is a wrapper around the excellent Apache Libcloud library.

Documentation

The full documentation is at https://dj-libcloud.readthedocs.org.

Quickstart

Libcloud verifies server SSL certificates before it lets you do anything. It will search your system for the CA certificate, and if it doesn’t find it then it will blow up. See https://libcloud.readthedocs.org/en/latest/other/ssl-certificate-validation.html

Installing CA certificate bundle on Mac OS X:

# Assuming you are using homebrew for Mac OS X dependency management.
$ brew install curl-ca-bundle

Install dj-libcloud:

$ pip install dj-libcloud

Then use it in a project, e.g. for your static files:

# settings.py

STATIC_URL = 'https://s3.amazonaws.com/my-assets/'
STATICFILES_STORAGE = 'djlibcloud.storage.LibCloudStorage'

LIBCLOUD_PROVIDERS = {
    'default': {
        'type': 'libcloud.storage.types.Provider.S3',
        'user': os.environ.get('AWS_ACCESS_KEY'),
        'key': os.environ.get('AWS_SECRET_KEY'),
        'bucket': 'my-assets',
        'secure': True,
    },
}

Other LibCloud Providers

If you want to use other libcloud providers (Rackspace, Openstack, other AWS centers, et al), please visit:

Features

  • Works for uploading media assets using Python 3.3 and Django 1.6.

  • In theory supports all the backends that libcloud supports.

FAQ

Because you just had to ask.

Why not use dj-static or whitenoise?

Those are great libraries, but are not what you want when handling user uploaded media.

Why not just update django-storages?

libcloud is awesome and has a dedicated team devoted to it. We can have it do most of the heavy lifting. On the other hand, converting django-storages to work with Python 3 looked like too much work. Sometimes you just have to start anew, right?

What storage providers does dj-libcloud support?

dj-libcloud is a wrapper around libcloud, meaning it supports all the providers of that library. Check out the full list of supported providers!

How can I contribute?

Please read http://dj-libcloud.readthedocs.org/en/latest/contributing.html

What about compressors like django-pipeline?

Working on it. Currently the PipelineCachedCloudStorage class breaks the second time you run it. See https://github.com/pydanny/dj-libcloud/issues/7

CREDIT

Many thanks to Jannis Leidel (@jezdez) for giving me the code to get this started. He’s a Django core developer, the master of Django static asset managment, and overall a great great guy.

History

0.2.0(2014-06-23)

  • Updated url method to return correct values for Rackspace Cloudfiles, Microsoft Azure, Google Storage, non-US Amazon SV (Thanks Jannis!)

  • Improved the cookbook immensely (Thanks Jannis!)

  • Add link from README to cookbook

  • Fix url method for Google Storage, Rackspace Cloudfiles and Microsoft Azure. Also return the correct value for non-US Amazon S3 buckets.

0.1.2 (2014-04-24)

  • Confirmed to work with Python 2.7

  • Remove django-pipeline specific code from storages

  • Add cookbook to docs that includes django-pipeline

0.1.1 (2014-04-21)

  • Fixed second-time run problem by just using LibCloudStorage class

  • Made django-pipeline optional

  • Removed unnecessary files

  • Moved TODO to issue tracker

0.1.0 (2014-04-21)

  • First release on PyPI.

  • Frustration over lack of easy media asset support for Django and Python 3.

Release files for dj-libcloud 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dj-libcloud 0.2.0
File Size Uploaded
dj-libcloud-0.2.0.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dj-libcloud 0.2.0
File Interpreter ABI Platform
dj_libcloud-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 18.3 kB

Release files / dj-libcloud-0.2.0.tar.gz

Download URL dj-libcloud-0.2.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b7b4ac3567c9ce696cea3cfee49c537928a9fcab2e6b3420587146376870809a
BLAKE2b-256 checksum
How to use checksums
4d520ac95e28d5860a0d38c485cf55faf856d7492dc75b92bd33123b5094194d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / dj_libcloud-0.2.0-py2.py3-none-any.whl

Download URL dj_libcloud-0.2.0-py2.py3-none-any.whl
Size 9.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9c7b25e2374f17e8265d96270e3e98dd6807acaf09fd7d62c78003e295b7783d
BLAKE2b-256 checksum
How to use checksums
87573d874cbe39afb94d86e9d9fbb14328f403cd9c4710c89b762e5d85cad95c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page