vendredi 24 avril 2015

Developing Django app to be hosted locally with sensitive database data

I am currently developing a Django application that is intended to be hosted locally only, on a laptop at work. I have been writing and testing the code on my own laptop and pushing the code to a private BitBucket repository for basic version control. Ultimately, the data in on the deployment machine is sensitive so I have been using dummy data on my development machine.

I have now effectively mirrored the application code onto the deployment machine and manually inputted the sensitive data on that machine, so I effectively have a working application on the target laptop which is identical to that on my development machine, except the contents of the database is different.

I need to be able to continue developing new features on my development machine - using dummy data - and I'd like to be able to push to the deployment machine via the remote repository. The problem I have is that if simply use gitignore to prevent pushing the db.sqlite containing the dummy data, the databases are not in sync, and some new features may include changing or adding the database schema - adding tables and fields and the like.

I could continue like this but only pull down the application code to the deployment machine and manually make changes to the db.sqlite on deployment but that is tedious and error prone.

I'm not entirely sure whether there is a purely git-based solution to this problem or a Django-based solution: unfortunately, I'm not an expert in either, so would welcome any views! Thanks.

Aucun commentaire:

Enregistrer un commentaire