1

I created the django app, I have it connected to my local server with pgAdmin3. I want to have the django app push to bitbucket. But the problem is:

How do I setup Postgres database, so that everything I commit and push, my group member can pull and have the same data?

2 Answers 2

2

Bitbucket is used to host your source code, not your database data.

If you setup a local database, only you, will be able to access these data. If you setup a remote database, you and your teammates will be able to access data. But it's absolutely not recommended during development because each person are not working on the same task and database migration can mess up the work of one of your colleagues.

If you want share data and populate your database during development, you are searching fixtures : Django Wiki - Fixture

Fixtures files are a good way to share data to populate your database. Theses files can be versioned on Bitbucket.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I guess I'll try to put the database on a free server then.
0

Step: 1

pip install psycopg2

For mac if you can’t install or the above command doesn’t work, use the following command instead, just add — binary

pip install psycopg2-binary

Step: 2 settings.py add configuration.

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'db_name', 
    'USER': 'db_user', 
    'PASSWORD': 'db_password',
    'HOST': '127.0.0.1', # DB host
    'PORT': '5432', # DB port
}

}

1 Comment

Edit your answer and place } in code blocks properly, currently it is outside the blocks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.