Showing error when I migrate my prject
pvxamjad
TRIALOP

a year ago

I am just studying django ecommerce project via youtube, when it comes connect cloud postgresql i got an error. I done same as the youtuber did but when python manage.py runserver it shows an error.

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\migrations\executor.py", line 18, in init

self.loader = MigrationLoader(self.connection)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\migrations\loader.py", line 58, in init

self.build_graph()

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\migrations\loader.py", line 235, in build_graph

self.applied_migrations = recorder.applied_migrations()

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\migrations\recorder.py", line 89, in applied_migrations

if self.has_table():

^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\migrations\recorder.py", line 63, in has_table

with self.connection.cursor() as cursor:

^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\utils\asyncio.py", line 26, in inner

return func(*args, **kwargs)

^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\backends\base\base.py", line 320, in cursor

return self._cursor()

^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\backends\base\base.py", line 296, in _cursor

self.ensure_connection()

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\utils\asyncio.py", line 26, in inner

return func(*args, **kwargs)

^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\backends\base\base.py", line 278, in ensure_connection

with self.wrap_database_errors:

^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\utils.py", line 91, in exit

raise dj_exc_value.with_traceback(traceback) from exc_value

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\backends\base\base.py", line 279, in ensure_connection

self.connect()

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\utils\asyncio.py", line 26, in inner

return func(*args, **kwargs)

^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\backends\base\base.py", line 256, in connect

self.connection = self.get_new_connection(conn_params)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\utils\asyncio.py", line 26, in inner

return func(*args, **kwargs)

^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\django\db\backends\postgresql\base.py", line 332, in get_new_connection

connection = self.Database.connect(**conn_params)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\amjad\Desktop\ecom\virt\Lib\site-packages\psycopg2\__init__.py", line 122, in connect

conn = connect(dsn, connectionfactory=connection_factory, **kwasync)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

django.db.utils.OperationalError: could not translate host name "postgres.railway.internal" to address: No such host is known.

i just shared half of the error

the same occurs when runserver

2 Replies

a year ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody over 1 year ago


pvxamjad
TRIALOP

a year ago

ok


pvxamjad
TRIALOP

a year ago

anyone had the same error and finded solution for this please reply


Loading...