Open eliziario opened 2 years ago
from tenant_schemas.postgresql_backend.introspection import DatabaseSchemaIntrospection
File ".venv/lib/python3.8/site-packages/tenant_schemas/postgresql_backend/introspection.py", line 13, in
from django.utils.encoding import force_text ImportError: cannot import name 'force_text' from 'django.utils.encoding'
replace "force_text" with "force_str"
In Django 4.1.2 I get
from django.utils.encoding import force_text ImportError: cannot import name 'force_text' from 'django.utils.encoding' (/home/kenytux/.local/lib/python3.10/site-packages/django/utils/encoding.py errors)
When running the django-tenant-schemas/examples/tenant_tutorial
Have the same issue on Django 4.0.8 Django Cookiecutter.
File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 113, in load_backend
return import_module("%s.base" % backend_name)
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/local/lib/python3.9/site-packages/tenant_schemas/postgresql_backend/base.py", line 11, in <module>
from tenant_schemas.postgresql_backend.introspection import DatabaseSchemaIntrospection
File "/usr/local/lib/python3.9/site-packages/tenant_schemas/postgresql_backend/introspection.py", line 13, in <module>
from django.utils.encoding import force_text
ImportError: cannot import name 'force_text' from 'django.utils.encoding' (/usr/local/lib/python3.9/site-packages/django/utils/encoding.py)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/manage.py", line 31, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 420, in execute
django.setup()
File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 116, in populate
app_config.import_models()
File "/usr/local/lib/python3.9/site-packages/django/apps/config.py", line 304, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/models.py", line 3, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/base_user.py", line 49, in <module>
class AbstractBaseUser(models.Model):
File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 141, in __new__
new_class.add_to_class("_meta", Options(meta, app_label))
File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 369, in add_to_class
value.contribute_to_class(cls, name)
File "/usr/local/lib/python3.9/site-packages/django/db/models/options.py", line 235, in contribute_to_class
self.db_table, connection.ops.max_name_length()
File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 15, in __getattr__
return getattr(self._connections[self._alias], item)
File "/usr/local/lib/python3.9/site-packages/django/utils/connection.py", line 62, in __getitem__
conn = self.create_connection(alias)
File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 208, in create_connection
backend = load_backend(db["ENGINE"])
File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 126, in load_backend
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: 'tenant_schemas.postgresql_backend' isn't an available database backend or couldn't be imported. Check the above exception. To use one of the built-in backends, use 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql', 'sqlite3'```
Abandoned project...
Check out Django-tenants
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Felipe Guimarães @.> Sent: Saturday, November 5, 2022 9:01:22 AM To: bernardopires/django-tenant-schemas @.> Cc: Subscribed @.***> Subject: Re: [bernardopires/django-tenant-schemas] Support for django 4.0 (Issue #683)
Abandoned project...
— Reply to this email directly, view it on GitHubhttps://github.com/bernardopires/django-tenant-schemas/issues/683#issuecomment-1304323624, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AETWCMG33GDARTHHTXJJEETWGWIUFANCNFSM5TO4AJVQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>
If interested, please take a look at the following PR: https://github.com/bernardopires/django-tenant-schemas/pull/693
+1 In Django 3.2.x I get these deprecation warnings