Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9271773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:42:20+00:00 2026-06-18T15:42:20+00:00

A buddy and I are developing a Django app and are using git. As

  • 0

A buddy and I are developing a Django app and are using git.

As we work, we make fake accounts on our site, login, and upload content to the database, etc..for testing purposes. Every time we merge branches, we get merge conflicts in our database file. The database file is in the repository, and, since we’re testing separately, the local copies of the file develop differently.

How do I prevent the database file from being tracked, so we can each keep our local copies?

With the following, we’ve been able to avoid using a local path:

## settings.py


from os.path import dirname, join

PROJECT_DIR = dirname(__file__)

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': join(PROJECT_DIR, 'foo.db'),
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    }
}

What would be ideal, is something like:

## settings.py


from os.path import dirname, join

PROJECT_DIR = dirname(__file__)

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': join('../../../', PROJECT_DIR, 'foo.db'), # this path is outside the repository (ie, 'Users/sgarza62/foo.db')
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    }
}

How can we keep our database files from being committed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:42:22+00:00Added an answer on June 18, 2026 at 3:42 pm

    Add your database file to .gitignore. Then you can keep it in its current location, but it will not be under version control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am developing application in blackberry and i m using eclipse.in my app there
DataAnnotations does not work with buddy class. The following code always validate true. Why
i am Developing app for Blackberry.in button click event i want to hide/invisible verticalFieldManager
me and my buddy are working on a program for our Object Oriented Programming
I'm using buddy.com and the docs for MetaData_UserMetaDataValue_Set say: string MetaLatitude - The latitude
I'm trying to add a new buddy to the user's roster using this line
I am building a XMPP chat client app with eclipse, java and asmack. Using
I've wracked my brain on using the MetadataType / buddy class to get DisplayName
I'm doing some complex querying using Lucene 4.0, and my information-retrieval-theory buddy has told
I am curious as to why data validation is done using buddy classes. Consider

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.