Skip to main content

⚠️ Deprecated — project renamed to django-cloud-backup

This is the final release of django-gdrive-backup and it will receive no further updates or support. Development continues as django-cloud-backup (module cloud_backup), which adds S3-compatible (AWS, Backblaze B2, Cloudflare R2) and Azure Blob Storage destinations alongside Google Drive, multiple named backup destinations, client-side encryption and ransomware protection. See its README for migration notes (renamed settings, URL namespace, Celery task names).


PyPI version

django-gdrive-backup

Backs up django postgres databases, local folders and S3 folders to a Google Drive folder through a google service account.

encrypted-credentials

This package uses encrypted-credentials and the instructions there could be useful. Adding the following lines to settings.py will initialise the package

from encrypted_credentials.django_credentials import add_encrypted_settings

add_encrypted_settings(globals())

Create service account

Requires a Google service account with the Google Drive API enabled

https://console.cloud.google.com/apis/credentials/serviceaccountkey

Add to gdrive_backup installed apps

settings.py

INSTALLED_APPS = [ ..
        'gdrive_backup',
    ]

Store service account key

By default encrypted-credentials is used to store the key. Create a directory off the django projects BASE_DIR called credentials and save the json key.

settings.py

CREDENTIAL_FOLDER = os.path.join(BASE_DIR, 'credentials')
CREDENTIAL_FILES = {
    'drive': 'service-account.json',
}

Create Google Drive folder and share with service account

With a Google Drive account create a folder and share with the email address of the service account.

Ensure psql is available to python subprocess

For docker containers you may need to something similar to the following line in the Dockerfile dependent on the version of Postgres.

RUN apt-get -y install postgresql-client-11

Configure database backup

settings.py

BACKUP_GDRIVE_DIR = 'django_backup'

Management commands

python manage.py backup_website
python manage.py restore_db

Management page

urls.py

urlpatterns = [
                path('backup/', include('gdrive_backup.urls')),
                ....

An enhanced version of the management page will be shown if the following django apps are installed

'django_modals', 'django_datatables', 'django_menus', 'ajax_helpers'

from the following PyPi packages

django-nested-modals, django-filtered-datatables, django-tab-menus, django-ajax-helpers

Configure S3 folder backups

settings.py

        AWS_ACCESS_KEY_ID = id
        AWS_SECRET_ACCESS_KEY = key
        AWS_PRIVATE_STORAGE_BUCKET_NAME = bucket
        
        S3_BACKUP_DIRS = [('S3-source-folder1', 'google-drive-folder1'),
                          ('S3-source-folder2', 'google-drive-folder2')
        ]

Configure cleaning of old datatabase backups

settings.py

BACKUP_DB_RETENTION = [{'hours': 1, 'number': 4}, 
                       {'hours': 2, 'number': 10},
                       {'days': 1, 'number': 10},
                       {'months': 1, 'number': 36},
                       ]

Schedule backup with celery beat

CELERY_BEAT_SCHEDULE = {
    'backup': {
        'task': 'gdrive_backup.tasks.backup',
        'schedule': crontab(hour='8-19', minute=10, day_of_week='mon-fri')
    }
}

Release files for django-gdrive-backup 0.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-gdrive-backup 0.0.12
File Size Uploaded
django_gdrive_backup-0.0.12.tar.gz 17.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-gdrive-backup 0.0.12
File Interpreter ABI Platform
django_gdrive_backup-0.0.12-py3-none-any.whl Python 3 none any Details

Total release size:39.7 kB

Release files / django_gdrive_backup-0.0.12.tar.gz

Download URL django_gdrive_backup-0.0.12.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
960cc4f7a0d4537d9243341339fd2910203c41f450599a5f068f2ebeec55d188
BLAKE2b-256 checksum
How to use checksums
440a164da5e9d8b39c55d0b583fd286e2457dfbdbdce3ae8317c09e6e4e5b517
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.

Transparency log

Release files / django_gdrive_backup-0.0.12-py3-none-any.whl

Download URL django_gdrive_backup-0.0.12-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8e2947b0ebfa1c39a48ceb03e699e00109b38f02bb54281b2ba543521a1c4c9
BLAKE2b-256 checksum
How to use checksums
cdcfd1726722e41dd4f743616e22717eaf1743ea579adb3de417a0e9c5f41af1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.12 This release

2 release files

0.0.11

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page