Giter Club home page Giter Club logo

ii-django-backup's Introduction

ideallical django backup

pypi-version

Requirements

  • Python (3.5)

Installation

Install using pip...

$ pip install ii-django-backup

Running

$ python manage.py backup_database

Configuration

Configure ii-django-backup in your Django settings:

INSTALLED_APPS = {
    [..],
    'ii_django_backup',
    [..],
}

II_DJANGO_BACKUP = {
    'DIR': '/var/backups/',
    'DROPBOX_ACCESS_TOKEN': '**********',
    'DROPBOX_DIR': '/websitename/staging/',
    'USE_GZIP': True,
}

Setting II_DJANGO_BACKUP['DIR'] to '/var/backups/' let's ii-django-backup know where to store your backups locally. By default this is set to os.path.join(settings.BASE_DIR, 'backups'); this requires BASE_DIR being defined in your Django settings.

Setting II_DJANGO_BACKUP['DROPBOX_ACCESS_TOKEN'] to **********, enables backup to Dropbox using this access token. By default this is set to None.

Setting II_DJANGO_BACKUP['DROPBOX_DIR'] to /websitename/staging/ let's ii-django-backup know where to store your backups at Dropbox. By default this is set to None.

Setting II_DJANGO_BACKUP['USE_GZIP'] to True enables Gzipping the backup file. By default this is set to True.

Trouble shooting

Note that passwords are NOT sent over the commandline (for security reasons). Therefor you need to make sure the mysqldump and pgdump commands know your database's password to do backups without password prompt.

For Postgres:

either create a .pgpass file in your home-directory and chmod it 600. The content could look like this:

localhost:5432:database_name:username:secretPassword

or set an ENV named PGPASSWORD with your Postgres database password. For Heroku you would be able to do this like so:

$ heroku config:set PGPASSWORD=secretPassword

For MySQL:

Create a .my.cnf file in your home-directory and chmod it 600. The content could look like this:

[mysqldump]
user=username
password=secretPassword

[client]
user=username
password=secretPassword

ii-django-backup's People

Contributors

mvdwaeter avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

ii-django-backup's Issues

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.