Python Forum
Recommended way to store users,db credentials in a Python project?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recommended way to store users,db credentials in a Python project?
#3
You can find accidentally uploaded credentials on GitHub.
It's a bad idea to store the credentials in source code.
Just follow the concept, which is usee regular in PHP-Projects like Wordpress.
They store the credentials in a configuration file. If the project is hosted on GitHub,
you upload a credentials.example.ini instead your credentials. Additionally, if you use a vcs,
put your own credentials file on a ignore list. This file should never be uploaded.
Otherwise you'll have guests on your account ;-)

You can parse ini files with: https://docs.python.org/3/library/configparser.html
Or you just use the json format.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: Recommended way to store users,db credentials in a Python project? - by DeaD_EyE - May-31-2018, 12:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Recommended way to read/create PDF file? Winfried 3 2,895 Nov-26-2023, 07:51 AM
Last Post: Pedroski55
  Cannot find py credentials file standenman 5 1,652 Feb-25-2023, 08:30 PM
Last Post: Jeff900
  python application and credentials safety concern aster 4 3,523 Mar-06-2021, 06:51 PM
Last Post: snippsat
  Using python to execute app or cmd that requires admin credentials thewolf 0 2,117 Mar-05-2021, 08:15 PM
Last Post: thewolf
  httplib2 - how to see credentials added by add_credentials? MSV 2 2,172 Aug-05-2020, 12:24 PM
Last Post: MSV
  How does a set in python store the elements? idknuttin 5 2,798 Jul-10-2020, 10:46 PM
Last Post: Gribouillis
  How to make Python 3.7.6 accessible to users Doguhan 4 2,791 May-19-2020, 05:36 PM
Last Post: snippsat
  [split] Python Module for Druid Users - "druidpy!" adaomacarl 0 1,838 Jan-14-2020, 11:34 AM
Last Post: adaomacarl
  Reading blob data from database by python and store it in .zip format Adityasi 2 6,622 Nov-18-2019, 05:22 PM
Last Post: ibreeden
  How do I install apps from google play store? using python + selenium.. mongo 0 2,283 Aug-05-2019, 12:41 AM
Last Post: mongo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020