Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OperationalError at /admin/login/
- FATAL: password authentication failed for user "usr"
- FATAL: password authentication failed for user "usr"
- Request Method: POST
- Request URL: https://www.***.com/admin/login/?next=/admin/
- Django Version: 1.11
- Exception Type: OperationalError
- Exception Value:
- FATAL: password authentication failed for user "usr"
- FATAL: password authentication failed for user "usr"
- Exception Location: /***/lib/python3.5/site-packages/psycopg2/__init__.py in connect, line 130
- Python Executable: ***
- Python Version: 3.5.2
- DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.postgresql',
- 'NAME': 'db',
- 'USER': 'usr',
- 'PASSWORD': os.environ["DB_PASSWORD"],
- 'HOST': 'localhost',
- }
- }
- export DB_PASS="*******"
- export SECRET_KEY="******************************"
- [Unit]
- Description=gunicorn daemon
- After=network.target
- [Service]
- User=*****
- Environment=SECRET_KEY="**********************************"
- Environment=DB_PASS="***********"
- Group=www-data
- WorkingDirectory=/home/***/vp/vp/
- ExecStart=/home/***/vp/vpenv/bin/gunicorn --workers 3 --bind unix:/home/***/v$
- [Install]
- WantedBy=multi-user.target
- List of databases
- Name | Owner | Encoding | Collate | Ctype | Access privileges | Size | Tablespace | Description
- -----------+----------+----------+-------------+-------------+-----------------------+---------+------------+--------------------------------------------
- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | 6992 kB | pg_default | default administrative connection database
- template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| 6857 kB | pg_default | unmodifiable empty database
- | | | | | postgres=CTc/postgres | | |
- template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| 6857 kB | pg_default | default template for new databases
- | | | | | postgres=CTc/postgres | | |
- db | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres +| 7600 kB | pg_default |
- | | | | | postgres=CTc/postgres+| | |
- | | | | | vpusr=CTc/postgres | | |
- List of roles
- Role name | Attributes | Member of
- -----------+------------------------------------------------------------+-----------
- postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
- vp | | {}
- usr | | {}
- [Service]
- ...
- EnvironmentFile=/pathto/somefilewith_secrets
- [Service]
- ...
- Environment="DATABASE_PASSWORD=mypassword"
- /path-to-virtualenv/gunicorn
- --bind unix:/path_to_myproject.sock myproject.wsgi:application
- -e DATABASE_PASSWORD=mypassword -e my_var2=value2
- > DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2',
- 'NAME': 'db',
- 'USER': 'usr',
- 'PASSWORD': os.environ.get("DB_PASSWORD"),
- 'HOST': 'localhost',
- 'PORT': '',
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement