Is there a comment character for foreman's .env file?

混江龙づ霸主 提交于 2020-05-12 11:07:10

问题


Can you comment out lines in a .env file read by foreman?


回答1:


FWIW, '#' appears to work as a comment character.

It at least has the effect of removing unwanted environment declarations. It might be declaring others starting with a #, but... it still works.

EG

DATABASE_URL=postgres://mgregory:@localhost/mgregory
#DATABASE_URL=mysql://root:secret@localhost:3306/cm_central

results in postgres being used by django when started by foreman with this .env file, which is what I wanted.




回答2:


I THINK the app will ONLY look for specific variables inside .env, anything other than the predefined variables (pre-defined in the app files) will be ignored.

So anything you write there that is not used in your application files you can consider a comment. Similarly if you wanna comment out a variable then basically any change you make to the name will "comment it out"; for example, if you change DB_HOST to #DB_HOST then the latter will be ignored because the application is looking for 'DB_HOST' not '#DB_HOST'.



来源:https://stackoverflow.com/questions/26713508/is-there-a-comment-character-for-foremans-env-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!