S
S
S0ulReaver2012-05-07 11:28:00
git
S0ulReaver, 2012-05-07 11:28:00

Updating files with different content via Git?

I don’t even know how to ask the right question ... In general, I am extremely poorly familiar with Git, there is clearly not enough knowledge, maybe someone will tell you how to get out of the situation.
There is a server on Ubuntu, which is actually a server for a site in Python - Django. The site itself is in the Git repository on GitHub, and accordingly the repository has been cloned to the server. The development of the site takes place on the home computer, and accordingly, commits to Git go from it. Everything would be fine, if not for one thing: to work and test on a home computer, you need to specify the path to the sqlite3 database in the site config (settings.py). So on the server this path to the database is significantly different :(. It turns out that for the home computer and the server I have to keep 2 different configs. , which requires periodic changes.As a result, when changes are made in the config on the Git Pull server, of course, it refuses to do it, swearing at file differences. of course, in case of changes, you can fill in the config with handles, and forward the path to the database in it, but somehow this is not automated. Something tells me that I'm a fool, and there are ways out of the situation. Anyone suggest something?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
larikov, 2012-05-07
@S0ulReaver

How we did it - there is a settings.py file that contains development-specific settings. The settings.py includes globalsettings.py, which contains general settings that are the same for development and production versions. settings.py added to .gitignore

R
romik, 2012-05-07
@romik

I did this: in settings.py, global settings and code that includes settings..py (I used hostname as the name, but you can explicitly set env=dev/qa/prod in environment variables).
At the same time, you can keep all the settings in the git and not be afraid to lose them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question