Coder Social home page Coder Social logo

Still uses os.system about django-dbdump HOT 3 OPEN

robvdl avatar robvdl commented on June 24, 2024
Still uses os.system

from django-dbdump.

Comments (3)

sumpfralle avatar sumpfralle commented on June 24, 2024 2

Indeed, it seems to be a pityful situation :(
While looking for an alternative, I found django-dbbackup project (even including media backup).

from django-dbdump.

robvdl avatar robvdl commented on June 24, 2024

The reason I mentioned this is because I was about to start using this library but dropped it pretty quickly due to not having had a release for years and the 1.1 release on pypi is broken (issue with mixed tab characters), master has been fixed but several years later and still no pypi release, this project seems well and truely dead I'm afraid, which is sad as that leads to forks being published on pypi instead and generates a bit of a mess.

I ended up doing it myself in the end, you can just do something like this:

with open(dump_filename, 'w') as dump_file:
    subprocess.call(command, stdout=dump_file)

No need to use os.system here, you can pipe straight to the output file (I am using pg_dump and doing a binary dump).

Also a backup should contain the media directory in my mind as well as a db dump, a proper backup of a Django site contains both a db dump and media directory, though I can understand not everyone needs this, which is why I ended up doing my own thing in the end.

from django-dbdump.

robvdl avatar robvdl commented on June 24, 2024

Nice I ended up rolling my own solution but I'll star that project for later.

from django-dbdump.

Related Issues (5)

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.