How to manage configuration files when collaborating?

后端 未结 6 1353
春和景丽
春和景丽 2020-11-28 05:25

I\'m writing a short script with a few simple variables at the top of the page. I want to work on them with a friend, but we aren\'t sure how to manage the variables needing

6条回答
  •  青春惊慌失措
    2020-11-28 05:49

    Nowadays I use ENV vars for example in python/django, you can also add defaults to them. In the context of docker I can save the ENV vars in a docker-compose.yml file or an extra file which is ignored in version control.

    # settings.py
    import os
    DEBUG = os.getenv('DJANGO_DEBUG') == 'True'
    EMAIL_HOST = os.environ.get('DJANGO_EMAIL_HOST', 'localhost')
    

提交回复
热议问题