I got the following connection refuse. The environment is: Ubuntu 16.04, 
python 2.7 , virtualenv, the database is: 

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis', # Add 
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'arches',                      # Or path to database file if 
using sqlite3.
        'USER': 'postgres',                      # Not used with sqlite3.
        'PASSWORD': 'postgis',                  # Not used with sqlite3.
        'HOST': 'localhost',                      # Set to empty string for 
localhost. Not used with sqlite3.
        'PORT': '5432',                      # Set to empty string for default. 
Not used with sqlite3.
        'POSTGIS_TEMPLATE': 'template_postgis_20',
    }
}

/ArchesDir/ENV/bin/python /ArchesDir/arches/manage.py runserver 127.0.0.1:8000


The error log is:
Traceback (most recent call last):
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/utils/autoreload.py",
 
line 226, in wrapper
    fn(*args, **kwargs)
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
 
line 124, in inner_run
    self.check_migrations()
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 448, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/migrations/executor.py",
 
line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
 
line 52, in __init__
    self.build_graph()
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
 
line 203, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
 
line 65, in applied_migrations
    self.ensure_schema()
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
 
line 52, in ensure_schema
    if self.Migration._meta.db_table in 
self.connection.introspection.table_names(self.connection.cursor()):
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
 
line 231, in cursor
    cursor = self.make_debug_cursor(self._cursor())
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
 
line 204, in _cursor
    self.ensure_connection()
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
 
line 199, in ensure_connection
    self.connect()
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/utils.py",
 
line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
 
line 199, in ensure_connection
    self.connect()
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
 
line 171, in connect
    self.connection = self.get_new_connection(conn_params)
  File 
"/home/sugan/Workspace/ArchesDir/ENV/local/lib/python2.7/site-packages/django/db/backends/postgresql/base.py",
 
line 176, in get_new_connection
    connection = Database.connect(**conn_params)
  File 
"/home/sugan/Workspace/ArchesDir/ENV/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: could not connect to server: Connection 
refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

-- 
-- To post, send email to [email protected]. To unsubscribe, send 
email to [email protected]. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to