Search code examples
pythondjangopostgresqldjango-migrations

Python manage.py runserver raise NotSupportedError( django.db.utils.NotSupportedError: PostgreSQL 11 or lateed (found 10.22)


I'm beginner in python and django, I'm working on a windows 10 - 32 bits computer. I don't understand where is the problem, what I changed but when I run manage.py, It get this :

$ python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Users\kgonc\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\kgonc\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\core\management\commands\runserver.py", line 137, in inner_run
    self.check_migrations()
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\core\management\base.py", line 564, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\migrations\executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\migrations\loader.py", line 58, in __init__
    self.build_graph()
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\migrations\loader.py", line 235, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\migrations\recorder.py", line 81, in applied_migrations
    if self.has_table():
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\migrations\recorder.py", line 57, in has_table
    with self.connection.cursor() as cursor:
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\utils\asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\backends\base\base.py", line 323, in cursor
    return self._cursor()
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\backends\base\base.py", line 299, in _cursor
    self.ensure_connection()
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\utils\asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\backends\base\base.py", line 282, in ensure_connection
    self.connect()
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\utils\asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\backends\base\base.py", line 265, in connect
    self.init_connection_state()
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\backends\postgresql\base.py", line 251, in init_connection_state
    super().init_connection_state()
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\backends\base\base.py", line 232, in init_connection_state
    self.check_database_version_supported()
  File "C:\Users\kgonc\Desktop\carzone-project\env\lib\site-packages\django\db\backends\base\base.py", line 207, in check_database_version_supported
    raise NotSupportedError(
django.db.utils.NotSupportedError: PostgreSQL 11 or later is required (found 10.22).

Then, I understand that my postsql is not updated but I'm on a 32 byte windows and I cannot use postgre 11 or above. I tried to reverse my last migration but it does not work.


Solution

  • I guess you are using django 4.*. Try to use django 3.2 version.