I am working on connecting a Postgres DB to Django. I have created the db through pgAdmin 4 under the user postgres. I've set my environment variables as followed
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
try:
if sys.argv[1:2] != ['test']:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'HOST': env('PGHOST'),
'USER': env('PGUSER'),
'NAME': env('PGDATABASE'),
'PASSWORD': env('PGPASSFILE'),
'PORT': env('PGPORT'),
}
}
except:
pass
with my .env file containing each variable. When I try to migrate it through ubuntu command line I get the error database <dbname> does not exist I've installed psycopg2 and pillow and set local all postgres peer to local all postgres md5. my os is windows 11 so I am wondering if this is happening because my project directory is through ~/directory/to/path and postgres and pgAdmin are installed in /etc/postgresql/ and /mnt/c/'Program Files'/PostgreSQL? Should I move those files from / to ~?
NOTE: I've run psql canvasDB and got back role "awilbur" does not exist