#24797: Cannot run migrate without access to postgres database
--------------------------------------------+--------------------
     Reporter:  wftimg                      |      Owner:  nobody
         Type:  Uncategorized               |     Status:  new
    Component:  Core (Management commands)  |    Version:  1.8
     Severity:  Normal                      |   Keywords:
 Triage Stage:  Unreviewed                  |  Has patch:  0
Easy pickings:  0                           |      UI/UX:  0
--------------------------------------------+--------------------
 Similar to #24791, the change for ticket #16969 prevents Django from being
 able to run the migrate management command when using the PostGIS database
 backend on shared hosts, where you are not allowed to connect to the
 "postgres" database.

 The traceback, for reference (Django 1.8.1):
 {{{
 Traceback (most recent call last):
   File "manage.py", line 10, in <module>
     execute_from_command_line(sys.argv)
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/core/management/__init__.py",
 line 338, in execute_from_command_line
     utility.execute()
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/core/management/__init__.py",
 line 330, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/core/management/base.py",
 line 390, in run_from_argv
     self.execute(*args, **cmd_options)
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/core/management/base.py",
 line 441, in execute
     output = self.handle(*args, **options)
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/core/management/commands/migrate.py",
 line 91, in handle
     connection.prepare_database()
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/contrib/gis/db/backends/postgis/base.py",
 line 36, in prepare_database
     if self.template_postgis is None:
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/utils/functional.py",
 line 60, in __get__
     res = instance.__dict__[self.name] = self.func(instance)
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/contrib/gis/db/backends/postgis/base.py",
 line 28, in template_postgis
     with self._nodb_connection.cursor() as cursor:
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/db/backends/base/base.py",
 line 162, in cursor
     cursor = self.make_debug_cursor(self._cursor())
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/db/backends/base/base.py",
 line 135, in _cursor
     self.ensure_connection()
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/db/backends/base/base.py",
 line 130, in ensure_connection
     self.connect()
   File
 "/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/db/utils.py",
 line 97, in __exit__
     six.reraise(dj_exc_type, dj_exc_value, traceback)
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/db/backends/base/base.py",
 line 130, in ensure_connection
     self.connect()
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/db/backends/base/base.py",
 line 119, in connect
     self.connection = self.get_new_connection(conn_params)
   File
 
"/home/username/lib/python2.7/Django-1.8.1-py2.7.egg/django/db/backends/postgresql_psycopg2/base.py",
 line 172, in get_new_connection
     connection = Database.connect(**conn_params)
   File "/usr/local/lib/python2.7/site-packages/psycopg2/__init__.py", line
 164, in connect
     conn = _connect(dsn, connection_factory=connection_factory,
 async=async)
 django.db.utils.OperationalError: FATAL:  no pg_hba.conf entry for host
 "[local]", user "username_postgis", database "postgres", SSL off
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24797>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.2c63a328a26b073127d9ddb2d1226815%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to