It is known that when you are doing a development where there is a database involved it is necessary to keep a file where the credentials of the database are stored, that later in production this data changes, that is why you could have within your project a file called database.py with the following structure
DATABASES = {
'default': {
'ENGINE': 'sqlserver_ado',
'NAME': 'my_database',
'USER': 'my_db_user',
'PASSWORD': 'my_db_password',
'HOST': 'dbserver\ss2008',
}
}
Already in your code you import this file and call these constants to make the connection
import database
dbHost = database.DATABASES['default']['HOST']
dbUsername = database.DATABASES['default']['USER']
dbPassword = database.DATABASES['default']['PASSWORD']
dbName = database.DATABASES['default']['NAME']
If you are using a version control manager such as git, you can call this file database.sample.py to have it available, make a copy of your project by removing the sample from the file name and tell the repository that will ignore in the push, this so that the local configuration does not overwrite the configuration file in production