Skip to content

Storage implementation for Django that interacts with Google Drive

License

Notifications You must be signed in to change notification settings

conformist-mw/django-googledrive-storage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Google Drive Storage

Tests status Linter status django-googledrive-storage on Pypi Documentation Status

This is a Django Storage implementation that uses Google Drive as backend for storing data.

Quick start

Installation

pip install django-googledrive-storage

Setup

INSTALLED_APPS = (
     ...,
     'django.contrib.staticfiles',
     'gdstorage'
 )

Set the environment variable GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE_CONTENTS or path file in the settings.py: GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE.

Optional set GOOGLE_DRIVE_STORAGE_MEDIA_ROOT in the settings.py

Usage example

from gdstorage.storage import GoogleDriveStorage

# Define Google Drive Storage
gd_storage = GoogleDriveStorage()

...

class Map(models.Model):
    id = models.AutoField( primary_key=True)
    map_name = models.CharField(max_length=200)
    map_data = models.FileField(upload_to='maps', storage=gd_storage)

Documentation and Installation instructions

Documentation and installation instructions can be found at Read The Docs.

About

Storage implementation for Django that interacts with Google Drive

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%