Changes between Initial Version and Version 1 of Ticket #26893, comment 5


Ignore:
Timestamp:
Jul 14, 2016, 12:10:19 PM (8 years ago)
Author:
Surbier Christophe

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26893, comment 5

    initial v1  
    55
    66Thanks for your answer but the database had been already created by the PAAS Provider and the PostGis extension too. Now i'm just trying to create my tables but the connexion failed (even if a database name is provided as you can see in my settings file). In fact on my local machine with a PostgreSQL everything work fine. But it doesn't work when i try to launch with my provider settings. Because they don't give access to default postgres database. And if i edit the psycopg2 file base.py as i said, and add the DBNAME in the code, then it is working..
     7I don't know if it help but when a run the server it is working fine, when i run the migration connection fails...
     8Here are the logs (i have just replace my real password in the trace by the word password :) )
     9
     10(envpython)serveur:citiesaround csurbier$ python manage.py runserver
     11Performing system checks...
     12
     13System check identified no issues (0 silenced).
     14{'ENGINE': 'django.contrib.gis.db.backends.postgis', 'ATOMIC_REQUESTS': False, 'OPTIONS': {}, 'CONN_MAX_AGE': 0, 'URI': 'postgis://ua2phhilhulzwmqseowj:password@bdsn15qbq8xaqoa-postgresql.services.clever-cloud.com:5432/bdsn15qbq8xaqoa', 'HOST': 'bdsn15qbq8xaqoa-postgresql.services.clever-cloud.com', 'USER': 'ua2phhilhulzwmqseowj', 'PASSWORD': 'password', 'PORT': None, 'AUTOCOMMIT': True, 'NAME': 'bdsn15qbq8xaqoa', 'TIME_ZONE': 'UTC', 'DBNAME': 'bdsn15qbq8xaqoa', 'TEST': {'COLLATION': None, 'CHARSET': None, 'NAME': None, 'MIRROR': None}}
     15[('dbname', 'bdsn15qbq8xaqoa'), ('user', 'ua2phhilhulzwmqseowj'), ('password', 'password'), ('host', 'bdsn15qbq8xaqoa-postgresql.services.clever-cloud.com')]
     16dbname=bdsn15qbq8xaqoa user=ua2phhilhulzwmqseowj password= password host=bdsn15qbq8xaqoa-postgresql.services.clever-cloud.com
     17(0.105)
     18            SELECT c.relname, c.relkind
     19            FROM pg_catalog.pg_class c
     20            LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
     21            WHERE c.relkind IN ('r', 'v')
     22                AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
     23                AND pg_catalog.pg_table_is_visible(c.oid); args=None
     24(0.099) SELECT "django_migrations"."app", "django_migrations"."name" FROM "django_migrations"; args=()
     25
     26You have unapplied migrations; your app may not work properly until they are applied.
     27Run 'python manage.py migrate' to apply them.
     28
     29July 14, 2016 - 17:09:42
     30Django version 1.8, using settings 'citiesaround.settings'
     31Starting development server at http://127.0.0.1:8000/
     32Quit the server with CONTROL-C.
     33
     34^C(envpython)serveur:citiesaround csurbier$ python manage.py migrate
     35{'ENGINE': 'django.contrib.gis.db.backends.postgis', 'AUTOCOMMIT': True, 'ATOMIC_REQUESTS': False, 'NAME': None, 'CONN_MAX_AGE': 0, 'URI': 'postgis://ua2phhilhulzwmqseowj: password@bdsn15qbq8xaqoa-postgresql.services.clever-cloud.com:5432/bdsn15qbq8xaqoa', 'PORT': None, 'HOST': 'bdsn15qbq8xaqoa-postgresql.services.clever-cloud.com', 'USER': 'ua2phhilhulzwmqseowj', 'TEST': {'COLLATION': None, 'CHARSET': None, 'NAME': None, 'MIRROR': None}, 'TIME_ZONE': 'UTC', 'PASSWORD': 'tmdTEQ6yOVAOeMSRCu37', 'OPTIONS': {}, 'DBNAME': 'bdsn15qbq8xaqoa'}
     36[('dbname', 'postgres'), ('user', 'ua2phhilhulzwmqseowj'), ('password', 'password'), ('host', 'bdsn15qbq8xaqoa-postgresql.services.clever-cloud.com')]
     37dbname=postgres user=ua2phhilhulzwmqseowj password= password host=bdsn15qbq8xaqoa-postgresql.services.clever-cloud.com
     38Traceback (most recent call last):
     39  File "manage.py", line 10, in <module>
     40    execute_from_command_line(sys.argv)
     41  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
     42    utility.execute()
     43  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
     44    self.fetch_command(subcommand).run_from_argv(self.argv)
     45  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
     46    self.execute(*args, **cmd_options)
     47  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
     48    output = self.handle(*args, **options)
     49  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 91, in handle
     50    connection.prepare_database()
     51  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 36, in prepare_database
     52    if self.template_postgis is None:
     53  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/utils/functional.py", line 60, in __get__
     54    res = instance.__dict__[self.name] = self.func(instance)
     55  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 28, in template_postgis
     56    with self._nodb_connection.cursor() as cursor:
     57  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/db/backends/base/base.py", line 162, in cursor
     58    cursor = self.make_debug_cursor(self._cursor())
     59  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
     60    self.ensure_connection()
     61  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
     62    self.connect()
     63  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
     64    six.reraise(dj_exc_type, dj_exc_value, traceback)
     65  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
     66    self.connect()
     67  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/db/backends/base/base.py", line 119, in connect
     68    self.connection = self.get_new_connection(conn_params)
     69  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 175, in get_new_connection
     70    connection = Database.connect(**conn_params)
     71  File "/Users/csurbier/Documents/workspace/citiesaround/envpython/lib/python2.7/site-packages/psycopg2/__init__.py", line 166, in connect
     72    conn = _connect(dsn, connection_factory=connection_factory, async=async)
     73django.db.utils.OperationalError: FATAL:  permission denied for database "postgres"
     74DETAIL:  User does not have CONNECT privilege.
     75
Back to Top