bernardopires / django-tenant-schemas

Tenant support for Django using PostgreSQL schemas.
https://django-tenant-schemas.readthedocs.org/en/latest/
MIT License
1.45k stars 425 forks source link

Supported Version Django #689

Open willianmascimiano opened 1 year ago

willianmascimiano commented 1 year ago

What are the supported versions of django to use this library

fegma59 commented 1 year ago

Someone can send a answer? this lib doesn't working in Django 4+???

LeoBastos commented 1 year ago

I managed to run with python 11 and django 4.1. Below are the files I modified:

PS: I HAVEN'T TESTED ALL THE FUNCTIONALITIES YET, I'VE JUST BEEN ABLE TO RUN AND CREATE THE SCHEMAS FOR MY TESTING LABORATORY.

path => _venv > lib > site-packages > tenant_schemas > signals.py_

BEFORE

from django.dispatch import Signal post_schema_sync = django.dispatch.Signal(providing_args=['tenant']) post_schema_sync.doc = """ Sent after a tenant has been saved, its schema created and synced """

AFTER

from django.dispatch import Signal import django.dispatch

tenant = django.dispatch.Signal() post_schema_sync = tenant post_schema_sync.doc = """ Sent after a tenant has been saved, its schema created and synced """

Path => Settings.py (default Django)

Adding this imports bellow

import django from django.utils.encoding import force_str django.utils.encoding.force_text = force_str

google translate =)

sandeepbol commented 1 year ago

Some additional changes are required for the custom Middleware code and running the test cases. If interested, please take a look at the following PR: https://github.com/bernardopires/django-tenant-schemas/pull/693