Metadata-Version: 2.1
Name: private-django-googledrive-storage
Version: 1.6.0
Summary: Storage implementation for Django that interacts with Google Drive
Home-page: https://github.com/ebridges/django-googledrive-storage
Download-URL: https://github.com/ebridges/django-googledrive-storage/tarball/1.6.0
Author: Gian Luca Dalla Torre (modified by Edward Bridges)
Author-email: gianluca.dallatorre@gmail.com (github@eqbridges.com)
License: LICENSE.txt
Keywords: django google drive storage googledrive
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Django
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
License-File: LICENSE.txt
Requires-Dist: google-api-python-client (>=1.8.2)
Requires-Dist: google-auth (<2,>=1.28.0)
Requires-Dist: python-dateutil (>=2.5.3)
Requires-Dist: Django (>=2.2)

===========================
Django Google Drive Storage
===========================

|build-status| |lint| |pypi| |docs|

This is a `Django Storage <https://docs.djangoproject.com/en/dev/ref/files/storage/>`_ implementation that uses `Google Drive <https://drive.google.com>`_ as backend for storing data.

Quick start
-----------

Installation
************

.. code-block:: bash

   pip install django-googledrive-storage


Setup
*****

.. code-block:: python

   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
*************

.. code-block:: python

    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 <http://django-googledrive-storage.readthedocs.org/>`_.

.. |build-status| image:: https://github.com/conformist-mw/django-googledrive-storage/workflows/tests/badge.svg
    :target: https://github.com/conformist-mw/django-googledrive-storage/actions/workflows/tests.yml
    :alt: Tests status

.. |lint| image:: https://github.com/conformist-mw/django-googledrive-storage/workflows/lint/badge.svg
    :target: https://github.com/conformist-mw/django-googledrive-storage/actions/workflows/lint.yml
    :alt: Linter status

.. |pypi| image:: https://img.shields.io/pypi/v/django-googledrive-storage.svg
    :target: https://pypi.python.org/pypi/django-googledrive-storage/
    :alt: django-googledrive-storage on Pypi

.. |docs| image:: https://readthedocs.org/projects/django-googledrive-storage/badge/?version=latest
    :target: http://django-googledrive-storage.readthedocs.org/en/latest/?badge=latest
    :alt: Documentation Status
