Skip to main content

Google Cloud Storage file backend for Django

Project description

Google Cloud Storage file backend for Django

If you run your projects on Google’s appengine and you are using the django framework you might need this file backend since there is no way to upload files, images, etc on appengine. Although solutions exist for the amazon cloud storage i have not found a file backend for google cloud storage. This backend does work with google cloud storage, although in early development. I have used it with regular file uploads and with file manager solutions such as django-filer. The code as it is right now stores files for public use (i.e. a web site’s images)


You need to have an appengine project. This will not work as a standalone solution for non appengine django projects, since there is no authentication mechanism with the google cloud storage implemented.

### If you want to copy the files into your repository.

You need to install the GCS client library from

Just run pip install GoogleAppEngineCloudStorageClient -t <your_app_directory/lib>, or optionally, unzip the file and copy the src/cloudstorage folder into your project directory.


` pip install django-google-cloud-storage `

Or Just copy the google folder in your project directory


On your django file you need to add the following settings

GOOGLE_CLOUD_STORAGE_BUCKET = ‘/your_bucket_name’ # the name of the bucket you have created from the google cloud storage console GOOGLE_CLOUD_STORAGE_URL = ‘’ #whatever the ulr for accessing your cloud storgage bucket GOOGLE_CLOUD_STORAGE_DEFAULT_CACHE_CONTROL = ‘public, max-age: 7200’ # default cache control headers for your files

And finally declare the file storage backend you will use on your file

DEFAULT_FILE_STORAGE = ‘django_google_cloud_storage.GoogleCloudStorage’


Christos Kopanos (@ckopanos) - source code Richard Caceres (@rchrd2) - packaging into python module

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-google-cloud-storage-0.0.2.tar.gz (10.3 kB view hashes)

Uploaded source

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