Switching from user "postgres", I created a new Postgres user and changed my Django project to make use of this new user / credentials:
sudo -u postgres -i
psql -c "CREATE USER foo WITH PASSWORD 'xxxxxxxxxxxx' CREATEDB;"
psql -c "GRANT ALL PRIVILEGES ON DATABASE bar TO foo;"
In settings for Django:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'bar',
'USER': 'foo',
'PASSWORD': 'xxxxxxxxxxxx',
'HOST': 'localhost',
'ATOMIC_REQUESTS': True
}
}
But I get the error when using "python manage.py runserver":
django.db.utils.ProgrammingError: permission denied for relation django_migrations