You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for an insight, I have issues when bumping versions on my Django project. So far I've narrowed it to the pydantic version, yet I think bug may be somewhere around django-tenants and/or strawberry-graphql-django, that we use.
Issue is starting local development server using traditional ./manage.py runserver, Django initialization fail.
Error message is very weird, no pydantic source file is in traceback, but f I stick with pydantic v2.10.x problem does not occur.
Local development server
Traceback (most recent call last):
File "/app/manage.py", line 22, in <module>
main()
File "/app/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/core/management/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 75, in execute
super().execute(*args, **options)
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/core/management/base.py", line 459, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 112, in handle
self.run(**options)
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 119, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/utils/autoreload.py", line 668, in run_with_reloader
logger.info(
File "/usr/local/lib/python3.11/logging/__init__.py", line 1489, in info
self._log(INFO, msg, args, **kwargs)
File "/usr/local/lib/python3.11/logging/__init__.py", line 1634, in _log
self.handle(record)
File "/usr/local/lib/python3.11/logging/__init__.py", line 1644, in handle
self.callHandlers(record)
File "/usr/local/lib/python3.11/logging/__init__.py", line 1706, in callHandlers
hdlr.handle(record)
File "/usr/local/lib/python3.11/logging/__init__.py", line 974, in handle
rv = self.filter(record)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/logging/__init__.py", line 830, in filter
result = f.filter(record)
^^^^^^^^^^^^^^^^
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django_tenants/log.py", line 12, in filter
record.schema_name = connection.tenant.schema_name
^^^^^^^^^^^^^^^^^
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/utils/connection.py", line 15, in __getattr__
return getattr(self._connections[self._alias], item)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/utils/connection.py", line 62, in __getitem__
conn = self.create_connection(alias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/db/utils.py", line 193, in create_connection
backend = load_backend(db["ENGINE"])
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/db/utils.py", line 113, in load_backend
return import_module("%s.base" % backend_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django_tenants/postgresql_backend/base.py", line 10, in <module>
from django.contrib.contenttypes.models import ContentType
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/contrib/contenttypes/models.py", line 134, in <module>
class ContentType(models.Model):
File "/home/appuser/.cache/pypoetry/virtualenvs/mancub_core-il7asoJj-py3.11/lib/python3.11/site-packages/django/db/models/base.py", line 134, in __new__
raise RuntimeError(
RuntimeError: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Here I also include list of my dependencies from pyproject.toml
I've tried removing django-ninja as it was the only project to have Pydantic in dependencies, but it didn't help. Maybe somewhere is optional dependency (import under try block).
My question is, what have changed so much in Pydantic between version 2.10 and 2.11 that might have caused this?
I think I may need to go from empty django project and start adding things until it breaks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking for an insight, I have issues when bumping versions on my Django project. So far I've narrowed it to the pydantic version, yet I think bug may be somewhere around django-tenants and/or strawberry-graphql-django, that we use.
Issue is starting local development server using traditional
./manage.py runserver
, Django initialization fail.Error message is very weird, no pydantic source file is in traceback, but f I stick with pydantic v2.10.x problem does not occur.
Here I also include list of my dependencies from pyproject.toml
I've tried removing django-ninja as it was the only project to have Pydantic in dependencies, but it didn't help. Maybe somewhere is optional dependency (import under try block).
My question is, what have changed so much in Pydantic between version 2.10 and 2.11 that might have caused this?
I think I may need to go from empty django project and start adding things until it breaks.
Thanks for opinions.
Beta Was this translation helpful? Give feedback.
All reactions