Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. OperationalError at /admin/login/
  2. FATAL: password authentication failed for user "usr"
  3. FATAL: password authentication failed for user "usr"
  4. Request Method: POST
  5. Request URL: https://www.***.com/admin/login/?next=/admin/
  6. Django Version: 1.11
  7. Exception Type: OperationalError
  8. Exception Value:
  9. FATAL: password authentication failed for user "usr"
  10. FATAL: password authentication failed for user "usr"
  11. Exception Location: /***/lib/python3.5/site-packages/psycopg2/__init__.py in connect, line 130
  12. Python Executable: ***
  13. Python Version: 3.5.2
  14.  
  15. DATABASES = {
  16. 'default': {
  17. 'ENGINE': 'django.db.backends.postgresql',
  18. 'NAME': 'db',
  19. 'USER': 'usr',
  20. 'PASSWORD': os.environ["DB_PASSWORD"],
  21. 'HOST': 'localhost',
  22. }
  23. }
  24.  
  25. export DB_PASS="*******"
  26.  
  27. export SECRET_KEY="******************************"
  28.  
  29. [Unit]
  30. Description=gunicorn daemon
  31. After=network.target
  32.  
  33. [Service]
  34. User=*****
  35. Environment=SECRET_KEY="**********************************"
  36. Environment=DB_PASS="***********"
  37. Group=www-data
  38. WorkingDirectory=/home/***/vp/vp/
  39. ExecStart=/home/***/vp/vpenv/bin/gunicorn --workers 3 --bind unix:/home/***/v$
  40.  
  41.  
  42. [Install]
  43. WantedBy=multi-user.target
  44.  
  45. List of databases
  46. Name | Owner | Encoding | Collate | Ctype | Access privileges | Size | Tablespace | Description
  47. -----------+----------+----------+-------------+-------------+-----------------------+---------+------------+--------------------------------------------
  48. postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | 6992 kB | pg_default | default administrative connection database
  49. template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| 6857 kB | pg_default | unmodifiable empty database
  50. | | | | | postgres=CTc/postgres | | |
  51. template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| 6857 kB | pg_default | default template for new databases
  52. | | | | | postgres=CTc/postgres | | |
  53. db | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres +| 7600 kB | pg_default |
  54. | | | | | postgres=CTc/postgres+| | |
  55. | | | | | vpusr=CTc/postgres | | |
  56.  
  57. List of roles
  58. Role name | Attributes | Member of
  59. -----------+------------------------------------------------------------+-----------
  60. postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
  61. vp | | {}
  62. usr | | {}
  63.  
  64. [Service]
  65. ...
  66. EnvironmentFile=/pathto/somefilewith_secrets
  67.  
  68. [Service]
  69. ...
  70. Environment="DATABASE_PASSWORD=mypassword"
  71.  
  72. /path-to-virtualenv/gunicorn
  73. --bind unix:/path_to_myproject.sock myproject.wsgi:application
  74. -e DATABASE_PASSWORD=mypassword -e my_var2=value2
  75.  
  76. > DATABASES = {
  77. 'default': {
  78. 'ENGINE': 'django.db.backends.postgresql_psycopg2',
  79. 'NAME': 'db',
  80. 'USER': 'usr',
  81. 'PASSWORD': os.environ.get("DB_PASSWORD"),
  82. 'HOST': 'localhost',
  83. 'PORT': '',
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement