Skip to main content

Storage Engine for Django Project based on Google Drive Personal Drive

Project description

Google Drive Personal Storage for Django

GDPS is a django app to provide Google Drive as a Storage Backeend for Django Project. It can be used to store the files in the user space (visible in the Web UI of Google Drive) while other librairies propose the use of Google Cloud Project to achieve the same results (with the downside of not being able to see the uploaded files).

Features

  • Use your Personal Google Cloud Folder as a Storage Backend.
  • Few views are added for Authorization with Google Drive and its renew (if you decide later to change the Google Account used).
  • For convenience, few abstract models (abstract and on-demande obvisouly) are provided to add the functionnality of SoftDeletion to your project (which is important if you are manipulationg Files).

Inspiration

This package was hugely inspired by :

Installation

pip install gdpstorage

Setup

  1. Add "gdpstorage" to your INSTALLED_APPS setting like this :
    INSTALLED_APPS = [
        ...
        'gdpstorage',
    ]
  1. Include the gdpstorage's URLconf in your project urls.py like this:
path('gdps/', include('gdpstorage.urls'))
  1. Add The following settings to your settings.py :
# Replace [MY-GD-FOLDERNAME] by the name of your Google Drive Folder you wish to use as root Media folder.
GOOGLE_DRIVE_STORAGE_MEDIA_ROOT = "MY-GD-FOLDERNAME"
  1. Change your Default Storage Engine (if you want to use GD globaly, else you can change it on field basis using the storage keyword argument )
DEFAULT_FILE_STORAGE = "gdpstorage.storage.GoogleDriveStorage"
  1. Create your Oath2 application and download your client_secrets.json file (see https://github.com/torre76/django-googledrive-storage documentation for steps )
  2. Put your file client_secrets.json at the root of your Django project (beside manage.py)
  3. Authorize the access to your Google Drive Folder by visiting:
    http://127.0.0.1:8000/gdps/authorize
    

Development

Want to contribute? Great! Feel free to make a pull request or post any issues in the Github repo. https://github.com/jadliaissam/django-gdpstorage

License

MIT

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

gdpstorage-0.1.2.tar.gz (10.3 kB view details)

Uploaded Source

File details

Details for the file gdpstorage-0.1.2.tar.gz.

File metadata

  • Download URL: gdpstorage-0.1.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for gdpstorage-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5417623592931630763c5bc5d5f3ee920bdaa436a97711e18848be94e949015d
MD5 89561b0d11ec2eb40342262acb2eb506
BLAKE2b-256 ff3371f17cca3b00ff5cecfd139dbeaa41cbc908e1af829abfc9948cdb240a58

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page