Hello guys! I’m trying to connect django with my postgres app but i’m having some problems.
I’ve generated the DATABASE_URL like this:
flyctl pg attach ac7-postgres
Checking for existing attachments
Registering attachment
Creating database
Creating user
Postgres cluster ac7-postgres is now attached to ac7
The following secret was added to ac7:
DATABASE_URL=postgres://ac7:<‘PASSWORD’>@ac7-postgres.flycast:5432/ac7?sslmode=disable
So I have this code in settings.py:
os.environ['DATABASE_URL'] = 'postgres://ac7:<PASSWORD>@ac7-postgres.flycast:5432/ac7?sslmode=disable'
DATABASES = {
'default': dj_database_url.config(default=os.getenv('DATABASE_URL'))
}
but when I try “py manage.py makemigrations” it shows:
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xe3 in position 76: invalid continuation byte