Witosser
@Witosser
студент IT ВУЗа, увлекаюсь веб-разработкой

Как исправить ошибку в django после подключения БД PostgreSQL?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\Витор\AppData\Roaming\JetBrains\PyCharm 2016.1.2\helpers\pycharm\django_manage.py", line 41, in
run_module(manage_file, None, '__main__', True)
File "C:\Python35\lib\runpy.py", line 196, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "C:\Python35\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:/Users/Витор/PycharmProjects/untitled6\manage.py", line 22, in
execute_from_command_line(sys.argv)
File "C:\Python35\lib\site-packages\django\core\management\__init__.py", line 367, in execute_from_command_line
utility.execute()
File "C:\Python35\lib\site-packages\django\core\management\__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python35\lib\site-packages\django\core\management\base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python35\lib\site-packages\django\core\management\base.py", line 345, in execute
output = self.handle(*args, **options)
File "C:\Python35\lib\site-packages\django\core\management\commands\makemigrations.py", line 106, in handle
loader.check_consistent_history(connection)
File "C:\Python35\lib\site-packages\django\db\migrations\loader.py", line 276, in check_consistent_history
applied = recorder.applied_migrations()
File "C:\Python35\lib\site-packages\django\db\migrations\recorder.py", line 65, in applied_migrations
self.ensure_schema()
File "C:\Python35\lib\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 "C:\Python35\lib\site-packages\django\db\backends\base\base.py", line 231, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "C:\Python35\lib\site-packages\django\db\backends\base\base.py", line 204, in _cursor
self.ensure_connection()
File "C:\Python35\lib\site-packages\django\db\backends\base\base.py", line 199, in ensure_connection
self.connect()
File "C:\Python35\lib\site-packages\django\db\utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\Python35\lib\site-packages\django\utils\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "C:\Python35\lib\site-packages\django\db\backends\base\base.py", line 199, in ensure_connection
self.connect()
File "C:\Python35\lib\site-packages\django\db\backends\base\base.py", line 171, in connect
self.connection = self.get_new_connection(conn_params)
File "C:\Python35\lib\site-packages\django\db\backends\postgresql\base.py", line 176, in get_new_connection
connection = Database.connect(**conn_params)
File "C:\Python35\lib\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 (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 8000?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 8000?

Process finished with exit code 1
  • Вопрос задан
  • 1153 просмотра
Пригласить эксперта
Ответы на вопрос 1
Gasoid
@Gasoid
запустить постгрес, через докер быстрее всего
или использовать sqlite
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы