Hello,
DATABASES_DEFAULT = {
'ENGINE': 'django.db.backends.postgresql_psycopg2','NAME': 'litdb','USER': 'root','PASSWORD': '','HOST': 'localhost','PORT': '80',}
First, if this means what I think it means, it's a very nasty way to define your database. Instead, do this:
DATABASES = { 'default': { 'ENGINE': ..., ..., } } Now, for what you are asking, PostgreSQL does not listen on port 80; more likely it's listening on port 5432.
Regards,
A.
Antonis Christofides http://djangodeployment.com
On 2017-05-31 14:35, Bobby Paul wrote:
Dear All,--
I am getting this error message while trying to install psql database.
File "setup.py", line 18, in <module>execute_from_command_line(['manage.py','migrate'])File "/usr/local/bin/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_lineutility.execute()File "/usr/local/bin/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in executeself.fetch_command(subcommand).run_from_argv(self.argv)File "/usr/local/bin/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argvself.execute(*args, **cmd_options)File "/usr/local/bin/lib/python2.7/site-packages/django/core/management/base.py", line 445, in executeoutput = self.handle(*args, **options)File "/usr/local/bin/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 93, in handleexecutor = MigrationExecutor(connection, self.migration_progress_callback)File "/usr/local/bin/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__self.loader = MigrationLoader(self.connection)File "/usr/local/bin/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__self.build_graph()File "/usr/local/bin/lib/python2.7/site-packages/django/db/migrations/loader.py", line 191, in build_graphself.applied_migrations = recorder.applied_migrations()File "/usr/local/bin/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrationsself.ensure_schema()File "/usr/local/bin/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 49, in ensure_schemaif self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):File "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/base/base.py", line 162, in cursorcursor = self.make_debug_cursor(self._cursor())File "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursorself.ensure_connection()File "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connectionself.connect()File "/usr/local/bin/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__six.reraise(dj_exc_type, dj_exc_value, traceback)File "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connectionself.connect()File "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/base/base.py", line 119, in connectself.connection = self.get_new_connection(conn_params)File "/usr/local/bin/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 176, in get_new_connectionconnection = Database.connect(**conn_params)File "/usr/local/bin/lib/python2.7/site-packages/psycopg2/__init__.py", line 130, in connectconn = _connect(dsn, connection_factory=connection_factory, **kwasync)django.db.utils.OperationalError: server closed the connection unexpectedlyThis probably means the server terminated abnormallybefore or while processing the request.==========DATABASES_DEFAULT = {
'ENGINE': 'django.db.backends.postgresql_psycopg2','NAME': 'litdb','USER': 'root','PASSWORD': '','HOST': 'localhost','PORT': '80',}
How to sort this issue?
Kind RegardsBobby Paul
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b07acc86-a2a9-4fe7-9004-0f7a90fe4100%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.