Code Monkey home page Code Monkey logo

django-dbbackup-s3's Introduction

django-dbbackup-s3

Extend django-dbbackup to backup s3 data to DropBox

Dependencies

  • Django >=3.2, <4.0

Installation and configuration

  1. Create a new virtualenv and activate it
  2. Install the packages - pip install -r requirements.txt -U and add storage_sync to INSTALLED_APPS in Django settings.
  3. Make sure you have set the settings variables for django-storage packages
    1. AWS_ACCESS_KEY_ID
    2. AWS_SECRET_ACCESS_KEY
    3. AWS_STORAGE_BUCKET_NAME
    4. AWS_S3_REGION_NAME
    5. DROPBOX_OAUTH2_TOKEN
    6. DROPBOX_OAUTH2_REFRESH_TOKEN
    7. DROPBOX_APP_KEY
    8. DROPBOX_APP_SECRET
  4. Set the values for the following variables in settings.py
    1. SYNC_S3_BUCKET - The name of the bucket to sync (default: settings.AWS_STORAGE_BUCKET_NAME)
    2. SYNC_S3_DIR - The directory in the bucket to sync (default: s3-source-dir/)
    3. SYNC_DROPBOX_DIR - The directory in the dropbox the backup to be uploaded (default: dropbox-dest-dir/)
    4. SYNC_TARGET_FILE_NAME - The custom name of the file to be uploaded (default: backup.tar.gz)
  5. Run the management command - python manage.py s3backup (by default the management command will use the values defined in the settings.py. But, it can be overridden by passing commandline args)
    1. Run python manage.py s3backup --help to see all available options (incl. Compression of backup)

Run tests with docker

docker run -it --rm -v "$(pwd):/app" python:3.7 bash -c "cd /app; pip install -e .[tests]; pytest"

django-dbbackup-s3's People

Contributors

jerinpetergeorge avatar patroqueeet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.