Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Nicolas
    @Nicolas-SistemaFactoring
    It's possible to commit this from django-tenant-schemas, since django-tenants it's a fork from it? bernardopires/django-tenant-schemas#604
    I guess shouldn't be possible, in the django docs depreciation timeline the django.core.urlresolvers will be removed(or was it already) in django 2.0. https://docs.djangoproject.com/en/2.2/internals/deprecation/#deprecation-removed-in-2-0
    thenewguy
    @thenewguy
    It seems like it is generally bad to run manage.py migrate and one should always favor migrate_schemas, correct?
    thenewguy
    @thenewguy
    Could anyone share why you wouldn't want TENANT_LIMIT_SET_CALLS = True? The docs seem to indicate that there is no downside, yet the default is False
    Michael Jonaitis
    @korono89_twitter
    Hello
    I am having some issues getting a TenantTestCase To Run with nothing but self.assertTrue(True) in the test
    its saying that my accounts_user relation does not exist, im guessing its just the first model its looking for
    but i am unsure how to proceed
    my guess is that it is trying to find my model tables in the public schema
    could anyone lend a hand?
    thenewguy
    @thenewguy
    What is the best way to make health checks work regardless of what host they hit? I.e. kubernetes liveness check that uses a local ip instead of the configured tenant?
    Doing this in middleware?
    Here is an old discussion I found - I think it is in a previous project this is based on? - bernardopires/django-tenant-schemas#383 and bernardopires/django-tenant-schemas#421
    thenewguy
    @thenewguy
    ah nm. now I see where that middleware is in the package
    Still curious if the healthcheck is better as a middleware though that processes before anything else
    G. S. Amin Talukder
    @eamtalu
    Hi, Hope all good, a question: are all the schema associated with tenants should have same tables ? same structure ? same number of apps ? in other words, can the schema be different based on tenants ?
    David i.Rock
    @davidirock
    @eamtalu not necesarily, you may execute specific migrations (of any app) to a specific schema, then, fake it for all the other schemas, that way you will not get any conflicts. That is what I do
    G. S. Amin Talukder
    @eamtalu
    Thanks. so lets say if I want to populate the auth apps and related tables in each and every schema of tenants, those will not be conflict with each other right, specially the auth app from public ?
    also I have seen, content_type tables is created in all the schema containing app_label and tablename in all the schema ? why so and what is the necessity of content_type in all schema ? thanks
    @davidirock
    hexonomy
    @hexonomy
    Hi, I have this wierd problem where even if I create a new schema, the data is always read from the public schema
    I have the same identical apps between shared and tenant apps
    Tom Turner
    @tomturner
    @hexonomy You should have all the identical apps. If you haven't watched the YouTube video on how to set this up I would recommend it.
    hexonomy
    @hexonomy
    @tomturner I didn't set up the middleware. Once I used that, it started working fine. Thanks for responding
    Ghost
    @ghost~5f72f46fd73408ce4ff02b63
    @tomturner Hi, there. In my settings.py file, i have a variable called SITE_HOST_NAME='t1.demo.com', I would like to dynamically specify this variable, in a similar manner that we do for MULTITENANT_RELATIVE_MEDIA_ROOT or MULTITENANT_RELATIVE_STATIC_ROOT, how do i go about this?
    hexonomy
    @hexonomy
    Does django-tenants work with webhooks? I've just migrated my app over to a schema and everything looks great. It gets posted and the server returns a 200 success, but it doesn't save to DB or otherwise. The webhooks works great running it as a regular django web app
    I have tried to use @tenant_context(tenant) but this didn't resolve anything
    Juxtaposition
    @smilesntickles_twitter
    Ruchit Micro
    @RuchitMicro
    Hey does anybody know why tenant app's image model is linked to tenant subdomain url. Actually I want the tenant model's image to be shown on public url also.
    Ruchit Micro
    @RuchitMicro
    I have one event organiser tenant who publishes event inside event model, this tenant specific event model has a image field and I want to access this image field on front-end ie main portal without the subdomain. How to do that ?
    Ruchit Micro
    @RuchitMicro
    Excuse my dumbness I forgot to add urlpatterns in public urls.
    hexonomy
    @hexonomy
    What is the best way to return the current schema name?
    Juxtaposition
    @smilesntickles_twitter

    @tomturner Hi, there. In my settings.py file, i have a variable called SITE_HOST_NAME='t1.demo.com', I would like to dynamically specify this variable, in a similar manner that we do for MULTITENANT_RELATIVE_MEDIA_ROOT or MULTITENANT_RELATIVE_STATIC_ROOT, how do i go about this?

    can someone kindly respond? Thanks

    Bon Osonwanne
    @osonwanne
    has anyone used django-tenants, with Wagtail?
    thenewguy
    @thenewguy
    Anyone using django-tenants under ASGI? I hit django-tenants/django-tenants#532 - curious if it is a problem with something I am doing or not supported yet
    kyrylokaralyus
    @kyrylokaralyus:matrix.org
    [m]
    Hey all ! I'm a bit newbie, can't understand what I'm doing wrong when trying to launch example tutorial
    ace/django-tenants/django-tenants-master/examples/tenant_tutorial$ python manage.py runserver
    Watching for file changes with StatReloader
    Performing system checks...
    System check identified no issues (0 silenced).
    March 22, 2021 - 11:07:31
    Django version 3.1.3, using settings 'tenant_tutorial.settings'
    Starting development server at http://127.0.0.1:8000/
    Quit the server with CONTROL-C.
    Internal Server Error: /
    Traceback (most recent call last):
    File "/media/kyrylo/storage/Workspace/django-tenants/venv_django_tenants/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
    File "/media/kyrylo/storage/Workspace/django-tenants/venv_django_tenants/lib/python3.7/site-packages/django/core/handlers/base.py", line 165, in _get_response
    callback, callback_args, callback_kwargs = self.resolve_request(request)
    File "/media/kyrylo/storage/Workspace/django-tenants/venv_django_tenants/lib/python3.7/site-packages/django/core/handlers/base.py", line 288, in resolve_request
    resolver_match = resolver.resolve(request.path_info)
    File "/media/kyrylo/storage/Workspace/django-tenants/venv_django_tenants/lib/python3.7/site-packages/django/urls/resolvers.py", line 545, in resolve
    for pattern in self.url_patterns:
    File "/media/kyrylo/storage/Workspace/django-tenants/venv_django_tenants/lib/python3.7/site-packages/django/utils/functional.py", line 48, in **get**
    res = instance.**dict**[self.name] = self.func(instance)
    File "/media/kyrylo/storage/Workspace/django-tenants/venv_django_tenants/lib/python3.7/site-packages/django/urls/resolvers.py", line 589, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
    File "/media/kyrylo/storage/Workspace/django-tenants/venv_django_tenants/lib/python3.7/site-packages/django/utils/functional.py", line 48, in **get**
    res = instance.**dict**[self.name] = self.func(instance)
    File "/media/kyrylo/storage/Workspace/django-tenants/venv_django_tenants/lib/python3.7/site-packages/django/urls/resolvers.py", line 582, in urlconf_module
    return import_module(self.urlconf_name)
    File "/usr/lib/python3.7/importlib/**init**.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
    File "<frozen importlib._bootstrap>", line 983, in _find_and_load
    File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
    ModuleNotFoundError: No module named 'public'
    [22/Mar/2021 11:16:14] "GET / HTTP/1.1" 500 98907
    kyrylokaralyus
    @kyrylokaralyus:matrix.org
    [m]
    @osonwanne: hey, I'm also interested in that topic, let me know if you found a solution !
    kyrylokaralyus
    @kyrylokaralyus:matrix.org
    [m]

    also, is there any chance authors have a minute to clear things up on making a public app ? I'm a semi-newbie, can't get it to work. I want the main(public) page to list tenants, and main(public) admin to be able to add them. I do have

    PUBLIC_SCHEMA_URLCONF = 'projectname.public_urls' set in options, and my public_urls.py have urlpatterns = [ path('admin/', admin.site.urls),    path('',TenantListView.as_view(), name="tenant_list_view") ].

    tenant app admin is

    @admin.register(Tenant) 
    class TenantAdmin(TenantAdminMixin, admin.ModelAdmin):
        list_display = ('first_name', 'last_name', 'email')

    and tenant app views are:

    class TenantListView(ListView):
        model = Tenant
        template_name = 'tenant/tenants.html'
        context_object_name = 'tenants'
    Kazeem Oluwatobi Omoloja
    @omolojakazeem
    Hello guys, I just started using django-tenants. So I have an abstractbaseuser that is supposed to be part of the tenant app. But I alwasy run into issue, after running make migrations and I run python manage.py migrate_schemas --shared. Error = django.db.utils.ProgrammingError: relation "staff_staff" does not exist. custome user app name = staff, customer user model = Staff. Please anyone facing this error?
    Kazeem Oluwatobi Omoloja
    @omolojakazeem

    Hello guys, I just started using django-tenants. So I have an abstractbaseuser that is supposed to be part of the tenant app. But I alwasy run into issue, after running make migrations and I run python manage.py migrate_schemas --shared. Error = django.db.utils.ProgrammingError: relation "staff_staff" does not exist. custome user app name = staff, customer user model = Staff. Please anyone facing this error?

    @tomturner

    Damien Cuenot
    @dcuenot
    @omolojakazeem Hi, did you find a solution about your issue?
    kyrylokaralyus
    @kyrylokaralyus:matrix.org
    [m]
    Hello folx and hello @tomturner , had anyone created an api for registering tenants with django-rest framework ?
    Kazeem Oluwatobi Omoloja
    @omolojakazeem
    @dcuenot no I didn't find a solution yet bro. Are you having same issue?
    Rafael Reuber
    @rafaelreuber
    Someone are using django-tenants on production?
    Tom Turner
    @tomturner
    @rafaelreuber yes I am using django-tenents in production and lots of other people are too.
    shirishbhalekar
    @shirishbhalekar
    @omolojakazeem let us know if you find any solution here?
    opened a github issue for same django-tenants/django-tenants#605
    Hudeh
    @Hudeh
    hello friend, please am having the challenge of my tenant domain not working in heroku app but work fine in localhost have done all config and the client has been created in db of heroku and everything work fine in creating the tenant. but when i try to access subdomain.domain.com not working pls i need dis urgently as we have gone live. thanks