How can I save my secret keys and password securely in my version control system?

前端 未结 17 1782
生来不讨喜
生来不讨喜 2020-11-29 14:49

I keep important settings like the hostnames and ports of development and production servers in my version control system. But I know that it\'s bad practice to kee

17条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 15:15

    Usually, i seperate password as a config file. and make them dist.

    /yourapp
        main.py
        default.cfg.dist
    

    And when i run main.py, put the real password in default.cfg that copied.

    ps. when you work with git or hg. you can ignore *.cfg files to make .gitignore or .hgignore

提交回复
热议问题