django-google-cloud-storage
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)
Prerequisites
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 https://developers.google.com/appengine/docs/python/googlecloudstorageclient/download.
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.
Installation
` pip install django-google-cloud-storage `
Or Just copy the google folder in your project directory
Configuration
On your django settings.py 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 = ‘http://storage.googleapis.com/bucket’ #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 settings.py file
DEFAULT_FILE_STORAGE = ‘django_google_cloud_storage.GoogleCloudStorage’
Credits
Christos Kopanos (@ckopanos) - source code Richard Caceres (@rchrd2) - packaging into python module
Metadata
Release files for django-google-cloud-storage 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-google-cloud-storage-0.0.2.tar.gz | 10.3 kB | Without provenance | Details |
Release files / django-google-cloud-storage-0.0.2.tar.gz
| Download URL | django-google-cloud-storage-0.0.2.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c6154dda899de067b0144912c36101522055feb3589e8ef7ef9d65df6ae227e
|
|
BLAKE2b-256 checksum How to use checksums |
52209de255cc3eb8fa8e9361546e6628ffe0cb04ed559723a8682d451fd84117
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-google-cloud-storage 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.