Hiding settings.py passwords for Heroku Django deployment
问题 I have sensitive data (database passwords) in settings.py and I was advised to upload my Django project to a github repository before pushing it to Heroku on their "Getting Started with Django on Heroku". If I put settings.py in .gitignore, then presumably it won't get deployed with my project. How can I prevent settings.py from being exposed but still get it deployed with my project ? 回答1: You can use environment variables (with heroku config:add SECRET=my-secret ) to setup sensitive data