Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. # If you hardcode usernames and passwords, you cannot check in the code to public git repositories.
  2. # A solution I am using is to create a `credentials.json` file and storing the password there
  3. # cerdentials.json :
  4. # {
  5. # "user":"bharath",
  6. # "password":"bharath_secret_password"
  7. # }
  8. #
  9. # add this file to .gitignore
  10. #
  11. # This file my be protected on apache web server using -
  12. # <Files ~ "\credentials.json$">
  13. # Require all denied
  14. # </Files>
  15.  
  16. import json
  17.  
  18. with open('credentials.json') as json_data:
  19. credentials = json.load(json_data)
  20.  
  21. login(username=credentials['user'] password=credentials['password']")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement