I'm not able to connect proxy host database in Django

282 views Asked by At

after running

python manage.py runserver 

Got the Error port 5432 failed: FATAL: Feature not supported: RDS Proxy currently doesn’t support command-line options.

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'DATABASE_NAME',
        'USER': 'DATABASE_USER'
        'PASSWORD': 'DATABASE_PASSWORD'
        'HOST': 'PROXY_HOST',
        'PORT': '5432',
        'OPTIONS': {
            'options': f"-c search_path={DATABASE_SCHEMA}"
        },
    }
}

After commented OPTIONS -- {DATABASE_SCHEMA}

 models already migrated in particular schema but schema is not detected.


DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'DATABASE_NAME',
        'USER': 'DATABASE_USER'
        'PASSWORD': 'DATABASE_PASSWORD'
        'HOST': 'PROXY_HOST',
        'PORT': '5432',
        # 'OPTIONS': {
        #     'options': f"-c search_path={DATABASE_SCHEMA}"
        # },
    }
}

so finally getting migrations error because it's pointing to the database not particular schema

You have 178 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): **address, analytics, etc...**
Run 'python manage.py migrate' to apply them.
February 09, 2023 - 15:42:20
Django version 3.2.9, using settings 'MoreProjectAPI.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

it's not connected my schema could any one please suggest how can i fix this issue in root level not in every model level.

1

There are 1 answers

1
rymanso On

hi your server output after commenting looks fine, try migrating first as it suggests!

python manage.py migrate

or python3 manage.py migrate

or simply

./manage.py migrate

and then run your server