Ticket #7554: 7544.patch

File 7544.patch, 689 bytes (added by FunkyBob, 13 years ago)

This (untested) patch should let postgres log in without requiring you to type your password. HOWEVER-- the PG docs note it's still a POTENTIAL SECURITY ISSUE

  • django/db/backends/postgresql_psycopg2/client.py

    diff --git a/django/db/backends/postgresql_psycopg2/client.py b/django/db/backends/postgresql_psycopg2/client.py
    index a5c0296..391371c 100644
    a b class DatabaseClient(BaseDatabaseClient):  
    1515            args.extend(["-h", settings_dict['HOST']])
    1616        if settings_dict['PORT']:
    1717            args.extend(["-p", str(settings_dict['PORT'])])
     18        if settings_dict['PASSWORD']:
     19            os.environ['PGPASSWORD'] = settings_dict['PASSWORD']
    1820        args += [settings_dict['NAME']]
    1921        if os.name == 'nt':
    2022            sys.exit(os.system(" ".join(args)))
Back to Top