This video has been replaced please see • How to get Django Tena... for the new version. This video explains how you can use PostgreSQL schemas with Django using the Django Tenant library.
Really appreciate your work. I'm trying to get django tenants up with a custom user model. Should the custom User Model be in both tenant and shared apps or only in the shared apps?
## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost 127.0.0.1 www.dtdemo.local 127.0.0.1 t1.dtdemo.local 127.0.0.1 t2.dtdemo.local 127.0.0.1 t3.dtdemo.local 127.0.0.1 t4.dtdemo.local
Hi Tom, Thanks for this video. At last I found it after so long been searching for it. Please create a complete multi tenant app. BR, I am Nyoman, from Bali, Indonesia
Thanks, Tom for sharing this tutorial. I am looking for a solution to use URL parameters instead of subdomains. Eg: tenant app 1 - 127.0.0.1:8000/tenant/1/..... tenant app 2 - 127.0.0.1:8000/tenant/2/..... can you please help me?
@@tomspythonanddjango6269 Thank you. I am unable to make make the subdomains work on Heroku. I am not very deep in this area. I have built an awesome API with Django-Tenants/Django rest_framework and I have also added Django channels. After some sweats, I have it on Heroku and I can access the public domain. But I am not able to access any tenant-specific domain like famv.my-app.herokuapp.com (I don't pay yet for more dynos). Can you please share an idea with me to make the subdomains work? Thank you for your help.
@@tomspythonanddjango6269 I make it work wow. I have learned so much by deploying an api powered by Django/Django-tenants/Django-channels and make it work I feel like making a video tutorial about the process. hahah that was cool
@@poormancodespmc4598 Hey brother, I am trying to create a multi tenant application but not able to access the apis by the other computer on the same network. Please help if you know anything about this.
Man, I'm simultaneously very thankful and pissed at this, hours later, and still can't get it to work. Please add to the description that you need to install Postgres (and whether inside or outside of venv). Also at 10:05 you mention something you did outside of the tutorial but which is crucial to it, wtf, who does that >:(
Hi Tom. Thank you for the great package Django-tenants. I am implementing a project with it, a saas app. The challenge I am facing now is to give the clients the possibility to add their own apps. What I mean, I could allow the client X to add an app "Finance management", but when I will append the new app in the Tenants apps list, it will be available for all the other clients, not just the client X. That behavior would be annoying for the other clients who are not necessarily interested in it. Is there a way to do that with Django-tenants now? Just like Salesforce does, give the opportunity to add app/objects/tabs and so on for a specific client. I can create the logic for that the only concern is how to display the app only for the client who created it not all the clients. I hope the question is clear and you will find a moment to help me. Greetings from Haiti!
Not sure. I personal just unlock parts of my app with a table of add ons. However every tenant still gets all the database tables even if they don't need them. I hope this helps
Thanks for this great tutorial. Have a question, I developed my project based on this tutorial. I need to integrate celery so as to send reminders weekly or daily to each tenant. E.g If a tenant has a ToDo due tomorrow, the specific tenant gets the notification and the others don't. Any material I can use for such? Thanks in advance.
This a wonderful video. It worked like a charm. Thank you very much. Would you please make a video on how to add users to be linked from person to Django User as OneToOne relationship. Thanks again.
Good One Tom. If you can extend this app with user login/multi dashboard you will rock the RU-vid. Quality content related to SaaS don't exist for django on RU-vid.com.
Hi could you explain why in your case you left out the TenantAdminMixin when registering in admin as the docs include it: class ClientAdmin(TenantAdminMixin, admin.ModelAdmin). I followed your example and everything works fine but I realised I get errors if I include this TenantAdminMixin on trying to add Persons to any tenants. Is there any issues with leaving the mixin out?
Hi Tom! I can't serve my app on Apache using mod_wsgi daemon mode. It works running at runserver mode test. The Apache configuration in the docs didn't work for me. Do you have any help? Thanks for the video!
Please, could anyone share how they managed to make a view for registering a tenant and it's superuser ?! I've been struggling with this for days, with or without DRF , idk what to do... I have already managed to write a signal to create both tenant and superuser but still don't know how to give superuser a password !
This is very timely indeed! I'm trying to get django tenants up with allauth and boy, I have sooooo many questions! For instance, in the docs, the auth and session apps are only in the SHARED_APPS, but here they show also in TENANT_APPS as well. What is the consequence/reason of doing this?
@@tomspythonanddjango6269 Yes, that I got... it's the behavior of the apps appearing twice that confuse me. Like auth, for instance: does it mean I can have users that are global across all tenants and users that are tenant-specific?
Fernando Cordeiro yes and no to the users in the public. The problem is if you go both is that users will have the same is as the tenant users gets. Personally I would have the users only in the tenant. There is a project called django tenant users which is worth looking at I don’t use it however I know lots do.
@@thomasturner2279 Thank you so much for your reply. I've asked this to many of the people but you have only replied. I like to have contact with you for learning django. Shall i contact you through mail or skype. Kindly reply for this post also. If you are ok i'll give my skype id to you. Once again thanks for ur support.
Hallo Tom thanks to you i could implement multitenancy in django, but how to get my frontend (vue.js) to understand the tenant domains? in other word how to enable the frondend to serve all the other domains? any idea or a reference page that could help? thanks a lot!
Hi Mannar, I am doing the same using vue as my frontend and django-tenants as backend with postgres, working with some api, kind of not able to completely figure out the steps. if you wish, we can collaborate - gs_amin_iut@yahoo.com
@@amintalukder8583 Hello Amin, i figured it out, in my Vue Frontend there is something called base url, there i can inject the domain: t1.my-domain.com. Thanks :)
Just add a CreateView? Or a function based view and overtide the form_valid(). Then just create the objects that way. The tenant shema gets created when you call the save method.
Thanks @@thomasturner2279 Here it is claimed that your approach is not scalable. Am I missing something ? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-RKSwjaZKXL0.html Is it really just only the shared table architecture scalable?
@@erdem.demirci I will watch it later however from what I see he is wrong. The problem with shared architecture is that you have to put a ID of some kind in a lot of tables and there is more chance of data being seen by another client. Years ago I have designed systems like this and it was a nightmare! With tenants you isolate the data of each customer and is easier to manage.
@@thomasturner2279 For now, scalability is more important than isolation, so my concern is whether your approach is scalable. Is "Django-tenants" suitable for scaling? Meanwhile, we look forward your video series to learn more . Thanks
I did the same. Everything is ok. server is running without any error. but my page is not opening. Request Method: GET Request URL: 127.0.0.1:8000/ No tenant for hostname "127.0.0.1" These errors are showing
Thank you for your tutorial ! It really helped me, but I'm having trouble to access my server. My domain's name is: test.local. When I type test.local:8000 on the browser. I'm using swagger api to document my API. Can you please help me?
@@thomasturner2279 thank you very much ! Yesterday I saw one of your answers here showing how was your host file and I managed to do mine here. Can you please tell me, how can I redirect the tenant to its host after user registration? I’m getting the error like the tenant wasn’t created (but it was, I checked at database) and the page is not redirected. Appreciate any help
You can put person.html in a folder called `templates` that is inside of `myclientapp`. Make sure to include an empty file called `__init__.py` inside of `templates` so that django can discover it. So, to summarize: your file structure will look something like this: myclientapp/ `--> templates/ `------> __init__.py `------> person.html Hope this helps!
Hi Tom, Thanks Tom for this tutorial, While launching my application using below hosts after creating schema , my server is up but the page is not loading. t1.postgres.local:8000 t2.postgres.local:8000 Could you please help me to resolve this?
You may need to edit the `/etc/hosts` file on your computer so that `t1.postgres.local` and `t2.postgres.local` are redirected to localhost. (Also note that when editing the `/etc/hosts` file, you may need to do so with `sudo`, as it may be protected.) For example, here's what my `/etc/hosts` looks like. I followed Tom's tutorial and set up the domain for t1 and t2 to be `t1.myapp.local` and `t2.myapp.local`. 127.0.0.1 localhost 127.0.0.1 t1.myapp.local 127.0.0.1 t2.myapp.local I hope this helps!
@@AjibolaLDonjibson Yes, was wondering how you managed to do it! :D Something i'm looking at doing myself as i'm building an web app with django-tenants :) Thanks for getting back me!