From here, we add all database info as text:
DATABASES = {
\'default\': {
\'ENGINE\': \'django.db.backends.postgresql\',
\'NAME\': \'mydatabase\',
Would like to thank Sayse for the wonderful idea of using Environment variables. For those using Pycharm to connect to a mysql database, you need to create a 'USER' environment variable and call it using os.environ.get('environment variable', '') if you want to avoid storing the database password in the settings.py.