How to get Django Tenants up and running

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ม.ค. 2025

ความคิดเห็น • 122

  • @federbro
    @federbro 3 ปีที่แล้ว +40

    you don't always see project maintainers making video tutorials. i really appreciate your effort

  • @sharashellAcademy
    @sharashellAcademy 8 หลายเดือนก่อน +1

    Thanks so much sir. I was able to get Django tenant running for a project with no hassles cos of this video. Once again thank you for your time and effort.

  • @rahulramesh460
    @rahulramesh460 2 ปีที่แล้ว +4

    Hi Tom, I really appreciate the work that you have put up in here. This video is a life saver. Hoping to see more works on django tenants from your end. Once again, thank you for this wonderful tutorial.

  • @AmoahDevLabs
    @AmoahDevLabs ปีที่แล้ว +1

    I've been watching this gist from time to time. It is really incredible. Thanks for sharing.

  • @MikeSmithgb
    @MikeSmithgb 2 ปีที่แล้ว +2

    Thanks Tom, I think I am finally starting to get my head around Django tenants! Great video

  • @MrGdanny
    @MrGdanny 2 ปีที่แล้ว +1

    I don't usually comment on youtube videos to thank, but this video deserves it.
    Thanks Tom for an excellent package and a fantastic introductory video, even with my basic english I was able to understand everything.

  • @twattusbobble9845
    @twattusbobble9845 ปีที่แล้ว +2

    Question for you Tom..... I want to create a "register" page on the shared apps side that enables people to create their own tenant rather than me entering it manually every time. How can I do this?

  • @President_Ragnar
    @President_Ragnar ปีที่แล้ว +1

    I'm pushing to launch my tech startup and intending to build a solution for the public using Multi-Tenants as the bedrock of the idea's success... I really have some questions running through my mind... But i'll have to watch your remaining videos to see if I can get the answers...

  • @Teapot_418
    @Teapot_418 3 ปีที่แล้ว +5

    Thanks for the walkthrough Tom, hope to see more content from you. Keep it up!

  • @user-cu2yc6wn2s
    @user-cu2yc6wn2s 6 หลายเดือนก่อน +1

    Great tutorial. I've followed and am wondering why in my case the superuser does not get the tenant app model disabled in the admin panel.

  • @MrAverageViewer
    @MrAverageViewer ปีที่แล้ว +1

    Outstanding video, Tom! I wish I'd discovered your channel sooner :)

  • @adrianloo6173
    @adrianloo6173 3 ปีที่แล้ว +7

    Hi Tom, thank you so much for this project. The shared DB with dedicated schema approach is really great for small startups. Would it be possible to create a tutorial on signing up tenants and creating tenant superusers from the frontend?

    • @ProSimples
      @ProSimples 2 ปีที่แล้ว

      I am looking for this approach as well but it is being very hard to find the answer since there are new data laws in EU and other countries. The ones I have found are outdated.

  • @gursimranjitsingh7621
    @gursimranjitsingh7621 ปีที่แล้ว +1

    easiest demo, surely only who made this can this level of demo.
    i have seen many videos for this but coldnt understand the main flow.
    now i get it and can customize how my app is structured
    thanks

  • @dominiquekym7985
    @dominiquekym7985 10 หลายเดือนก่อน +1

    oohhh, this was life saving for me. Thank you

  • @innovator48
    @innovator48 3 ปีที่แล้ว +7

    Can you upload a video showing how to automatically create subdomains and superuser once new tenant registers in the SaaS website?

    • @alexgaetanopadula4057
      @alexgaetanopadula4057 3 ปีที่แล้ว

      i think this would happen automatically with whatever client is in the database.

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  3 ปีที่แล้ว +7

      Already on my list to create a video on this.

    • @erikv7619
      @erikv7619 2 ปีที่แล้ว

      @@tomspythonanddjango6269 Really looking forward to that video as well! :) Any idea when you might do it?

  • @shashishekharam5932
    @shashishekharam5932 3 ปีที่แล้ว +1

    Thank you so much Tom for this explanations. I have learned a lot from your video.

  • @Flaxymc
    @Flaxymc 2 ปีที่แล้ว

    Well-explained and insightful tutorial. Thank you for bringing up such an untrivial topic. Subscribed to see more interesting and advanced stuff.

  • @maisha-safari
    @maisha-safari 3 ปีที่แล้ว +1

    It was easy to follow and get started on django tenants. Thanks for this.

  • @collinsmuriuki3366
    @collinsmuriuki3366 2 ปีที่แล้ว +1

    A real legend. Love it!

  • @ingafter6335
    @ingafter6335 2 ปีที่แล้ว +1

    Hi
    Thanks for this great course.
    Please make more videos about django tenant with real world examples.

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  2 ปีที่แล้ว

      Planning to when I have time

    • @MrValVet
      @MrValVet ปีที่แล้ว

      @@tomspythonanddjango6269 We need more examples. Really struggling to implement correctly. Thanks!

  • @marciocapellari1981
    @marciocapellari1981 2 ปีที่แล้ว +1

    I really appreciate your effort. Thank you.

  • @jaitungodhani2334
    @jaitungodhani2334 ปีที่แล้ว +1

    Hello Tom
    I got the error when I tried to delete the object of the sweet_type model from the admin panel.
    Please do it in your project and conform.

  • @edmarmsampaio
    @edmarmsampaio 3 ปีที่แล้ว +1

    Great job! It's a very solid and well-designed piece of software.

  • @ianmjohn
    @ianmjohn 3 ปีที่แล้ว +2

    u are a kingpin..Congrats bro

  • @ingafter6335
    @ingafter6335 3 ปีที่แล้ว

    Hi,
    Thanks for your great and practical tutorials.
    Please create more videos about django tenants.

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  3 ปีที่แล้ว

      Reply have you seen my other view on Django tenants
      How to use views and ULS in Django Tenants
      th-cam.com/video/IrAz-q5rv3A/w-d-xo.html

  • @engcisco
    @engcisco 2 ปีที่แล้ว +1

    really appreciate your effort

  • @DirtySouth33T
    @DirtySouth33T ปีที่แล้ว

    Tom thanks for the video! What is the proper way to use a custom user model with django tenants? Is it ok to use it in the tenant app and shared at the same time? The shared one is essentially for creating tenants and deleting them etc... the tenant specific one is so tenants can add tenant specific users..?

  • @aminfas7760
    @aminfas7760 3 ปีที่แล้ว +1

    Thanks for the tutorial, It was really helpful to setup the package ! :)

  • @arhumaalhor6152
    @arhumaalhor6152 7 หลายเดือนก่อน +1

    you are amazing bro ,,, 🥰

  • @AdnanNazirAhmed
    @AdnanNazirAhmed ปีที่แล้ว +1

    why my migrate_schemas --shared isn't being recognized??? Any idea what could a person be missing?
    Edit
    my bad, didn't include 'django_tenants', in apps. Wasn't mentioned in docs either 😀😀😀

  • @hunarb.mohammed9189
    @hunarb.mohammed9189 3 ปีที่แล้ว

    i've created a project using django-tenants, and it currently use by some clients , but the problem is they have all the same invoice text , while they needs different text and logo in their invoices please is there a way to add different texts and logos per client

  • @LuisViteri-y1y
    @LuisViteri-y1y หลายเดือนก่อน

    Thank you very much is really great your tutorial Bro, thanks

  • @reynel4402
    @reynel4402 2 ปีที่แล้ว

    Hi Tom, thank you for this very useful package, i think i am missing something. how do you specified the domain when creating a tenant using subfolders? you have schema name: demo, name: demo, domain: ???. Thanks in advance.

  • @finnmacool3706
    @finnmacool3706 3 ปีที่แล้ว

    Great tutorial, Tom. Very helpful to hear from the package maintainer. I am getting an error when I add the line: "SHOW_PUBLIC_IF_NO_TENANT_FOUND = True" to the settings file. I get the following error in the terminal: "... SHOW_PUBLIC_IF_NO
    NameError: name 'SHOW_PUBLIC_IF_NO' is not defined"

  • @mosalam208
    @mosalam208 3 ปีที่แล้ว +1

    thanks Tom for the video , I have been using the library for a while now, but the only thing I'm struggling with is the documentation sometimes its not covering the right way to setup stuff and have to dive deep into the source code to know what to do !
    it would be great if you can do a video about writing unit tests with pytest and django_tenants cuz this part is a bit vague now for me and I would like to start writing tests for it
    thanks

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  3 ปีที่แล้ว +2

      I will add it to my list

    • @mosalam208
      @mosalam208 3 ปีที่แล้ว

      @@tomspythonanddjango6269 thanks , will be looking forward to watch it

  • @laffe5788
    @laffe5788 8 หลายเดือนก่อน +1

    Hi Tom! Was wondering if you offer developing help for hire? We need some help to implement multi-tenancy and authentication in django.

    • @thomasturner2279
      @thomasturner2279 8 หลายเดือนก่อน

      I am very busy at the moment. I would have to charge if I was to help.

    • @laffe5788
      @laffe5788 8 หลายเดือนก่อน

      @@thomasturner2279 Understood, we are happy to pay. Could you give me an email, or other preferred way of communication, such that we can get in contact with you?
      Best regards

    • @laffe5788
      @laffe5788 8 หลายเดือนก่อน

      ​@@thomasturner2279 Hi again, we understand you have a tight schedule, and we are happy to pay for your help. Could you give me your preferred method of contact, such that we can discuss further?
      Best regards

  • @BertVanAel-c5e
    @BertVanAel-c5e 16 วันที่ผ่านมา

    Excellent, thank you!

  • @istiakahmed6971
    @istiakahmed6971 ปีที่แล้ว

    how can I deploy it on aws? Any idea?

  • @hectorjfr
    @hectorjfr 3 ปีที่แล้ว +1

    Thanks for your video.!

  • @njabulophiri4583
    @njabulophiri4583 6 หลายเดือนก่อน +1

    Hi. Does anyone know if this package can be used with JWT for user authentication?

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  6 หลายเดือนก่อน +1

      Yes I use it with JWT

    • @njabulophiri4583
      @njabulophiri4583 6 หลายเดือนก่อน

      @@tomspythonanddjango6269 Thanks, Tom. You, Sir, are a champion!

  • @vesaalexandru6853
    @vesaalexandru6853 3 ปีที่แล้ว

    Awesome tutorial. Thanks for the resources. One question. If my app is deployed in AWS how should I create the tenant when I have an ip ? For la localhost host I understood is x.localhost but when it's an ip? Thanks a lot !

  • @mobesx
    @mobesx 2 ปีที่แล้ว +1

    Thanks Tom

  • @JillOverlord
    @JillOverlord 3 ปีที่แล้ว

    Very cool video. It was very helpful! Thank you!
    And I have one question, maybe you can answer: only in my case django-tenants corrupts grappelli app?
    Sorry for my english...

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  3 ปีที่แล้ว

      Thats becuase Django Tenants overwrites some default admin templates

  • @VijayKumar-dq3ph
    @VijayKumar-dq3ph 2 ปีที่แล้ว

    Hi Tom, I am trying to use django tenant for multi-DB setup , that is 2 databases. and wanted to override the TenantSyncRouter and make minor changes specific for my requirement. . How can I override it? or you have any other inputs for those who want to implement multi-DB using django-tenant?

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  2 ปีที่แล้ว

      Personally I would use it with multiple databases as you will lose some of the features. I think it you look though the issues in github someone might have asked the same question.

  • @Sports__zoo-f8z
    @Sports__zoo-f8z ปีที่แล้ว

    I want to use replica with tenant

  • @istiakahmed6971
    @istiakahmed6971 ปีที่แล้ว

    How to automate the cmd

  • @jesussamaelmoralemus8120
    @jesussamaelmoralemus8120 2 ปีที่แล้ว +1

    Bárbaro, increíble!

  • @muhammedovais6571
    @muhammedovais6571 3 ปีที่แล้ว

    Hey Tom, Thanks! I am struggling with deployment of my app on Heroku, specifically database with django tenants on heroku's postgres database add on. can you help?

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  3 ปีที่แล้ว

      Sorry I dom't use Heroku. I know you have to enable tenants / schemas in Heroku

  • @AkshayHarith
    @AkshayHarith 2 ปีที่แล้ว

    Hey Tom,
    We are using your package in our production environment and we have run into some weird issues with table migration of newly created apps. is there any way I can contact you to understand why that error is persisting?

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  2 ปีที่แล้ว +1

      My email address is in setup.py.

    • @AkshayHarith
      @AkshayHarith 2 ปีที่แล้ว

      @@tomspythonanddjango6269 Thank you. I have sent you an email and you should be receiving it from the same account that you are seeing here.

  • @johnjim3741
    @johnjim3741 3 ปีที่แล้ว

    Can you make one about Tenant Types?

  • @inouguys8136
    @inouguys8136 2 ปีที่แล้ว

    Hi Tom,
    Getting this error when trying to Deploy my django project (with multi tenants feature) on Heroku.
    AttributeError: 'DatabaseWrapper' object has no attribute 'set_schema'
    i am stuck at this point, could not find much info about this error online.
    Any suggestions would be greatly appreciated. Thanks

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  2 ปีที่แล้ว

      Sound like the setting file is wrong. Make sure the 'ENGINE' is set to 'django_tenants.postgresql_backend'. However I don't use Heroku

    • @inouguys8136
      @inouguys8136 2 ปีที่แล้ว

      @@tomspythonanddjango6269 Thank you for replying.
      1. I was able to resolve this issue by changing the database settings to the following code in settings.py file......
      DATABASE_URL='postgres:// user:pass@host/databasename
      DATABASES = {
      'default': dj_database_url.parse(
      os.environ['DATABASE_URL'],
      engine='django_tenants.postgresql_backend',
      conn_max_age=600,
      ssl_require=True
      )
      }
      At the bottom of settings
      django_heroku.settings(locals(), databases=False)
      2. You dont use Heroku, but do you know any other alternative where I can check the working of my Django tenant app before deploying it to live production.

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  2 ปีที่แล้ว

      @@inouguys8136 I personal use docker in development and production that way it easier to see if it works before going live. Other ways is to have a staging / testing server.

  • @1one737
    @1one737 ปีที่แล้ว +1

    Thanks so much for your claer explanation

  • @ajishstephen-bo3qw
    @ajishstephen-bo3qw 8 หลายเดือนก่อน

    how to host in server ?

  • @anointedgeorge1646
    @anointedgeorge1646 ปีที่แล้ว +1

    Thanks man, i appreciate your time and effort. It was very helpful.
    A quick one,
    TENANT_MODEL = "client.Client" # app.Model
    TENANT_DOMAIN_MODEL = "client.Domain" # app
    If i have multiple tenants, how do i register them like this (TENANT_MODEL and TENANT_DOMAIN_MODEL)?

  • @nifeneny
    @nifeneny 2 หลายเดือนก่อน

    What's the difference between django_tenants and django_tenant_schemas ?

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  2 หลายเดือนก่อน +1

      I forked Django Tenant Schemas as that packages wasn't being updated. It has since been updated to support django 4.
      The domain modal is the main difference.

    • @nifeneny
      @nifeneny 2 หลายเดือนก่อน

      @@tomspythonanddjango6269 Thanks. Domain model, you mean ?

  • @sebastiannarvaez23
    @sebastiannarvaez23 ปีที่แล้ว +1

    Thank you!!!!!!!!!!!!!!!!!!!!

  • @evrenbingol7785
    @evrenbingol7785 2 ปีที่แล้ว

    This is great but how do you go to public if you do not have show_public_if_no_Tenant_found.
    Like i want it to go to 404 unless the public url is typed explicitly.
    like public.localhost but when I do that it is not routed.
    Thanks

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  2 ปีที่แล้ว

      Write your own middleware. It’s really simple as you just base it of one that in the system. I have done that for my own project

  • @anjanesh
    @anjanesh 2 ปีที่แล้ว

    Now only I got context on what the term 'tenants' is in SaaS. I was thinking django-multisite all along.

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  2 ปีที่แล้ว

      Sorry I don’t understand you questions

    • @anjanesh
      @anjanesh 2 ปีที่แล้ว

      @@tomspythonanddjango6269 So this is for a dev bizman running a service for multiple users where each user has his or her own set of users ?

  • @андрейхоменко-и5я
    @андрейхоменко-и5я 2 ปีที่แล้ว

    Спасибо огромное за ваш труд.

  • @masoodazhar1342
    @masoodazhar1342 3 ปีที่แล้ว

    Please sir. may you uploading this.
    may you upload a video showing how to automatically create subdomains and superuser once new tenant registers in the SaaS website?

    • @masoodazhar1342
      @masoodazhar1342 3 ปีที่แล้ว

      please sir. we are waiting for this tut. when you upload.

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  3 ปีที่แล้ว +1

      @@masoodazhar1342 At some point I will do it. I have a lot on at the moment

  • @inouguys8136
    @inouguys8136 3 ปีที่แล้ว

    Tow please maka a tutorial on tenant-aware also. Thanks

  • @mikaeldoctore8200
    @mikaeldoctore8200 3 ปีที่แล้ว

    We also need more commands that makes taking care of things on django-tenants feel like breeze

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  3 ปีที่แล้ว

      What commands would you like to see.

    • @mikaeldoctore8200
      @mikaeldoctore8200 3 ปีที่แล้ว

      @@tomspythonanddjango6269 some commands could be a
      1. to seeding provided by django-tenants with dummy data despite tenant_command, django itself is limited here, so a hand is needed. specific schemas or all schemas, options if tenant , else shared or both
      2. Commands to auto update existing tables in tenants(already in multi tenant with data) or out of tenants(assuming single tenant) to be updated easily . assuming a change of a field name and or type is made, from "UID" to "tracking" with migrate_schemas I think there is a lot of limitations since it skips changes to migration during updates from what I have noticed. It works but not reflected in the database
      3. follow up on 2. especially is the upgrade deals with a field that is meant to be unique or not null, since during updates it asks for a default value which in the case of uniqueness, it cannot be null and can not have a default
      4. a reset for tenant(s) in case is necessary, so a user can reset all the changes made which will auto drop and auto create the table(s) within the schema or schemas e.g ./manage.py tenant_command --reset ---schema=demo1 or --schema="*" --exclude-public or --include-public which will do an iterative reset for all schemas excluding or including-public , default could be either exclude or include
      5. commands to support django in apii mode with DRF with api testing
      for now thats all

    • @mikaeldoctore8200
      @mikaeldoctore8200 3 ปีที่แล้ว

      and maybe commands to lock a user from accessing a schema once subscription expires

    • @mikaeldoctore8200
      @mikaeldoctore8200 3 ปีที่แล้ว

      one last thing is set up, apart from the tutorial and django's default can we have a set up that auto generates a tenant project like a wrapper around django if new or for single to multi tenant architectures, can auto generate files for tenants and override some defaults including settings which can still be modified further, check if there is existing django-tenants installed or not , asks for upgrades if a old version is used , checks for API or MVT mode, etc, will be very useful and django-tenants will defintely gain more users and more users with more subscribeers on your channel

    • @mikaeldoctore8200
      @mikaeldoctore8200 3 ปีที่แล้ว

      and lastly Thank you Tom for the efforts you have put in so far, for django-tenants, God Almighty himself will reward your good deeds

  • @bugsbunny6823
    @bugsbunny6823 3 ปีที่แล้ว +1

    lifesaver

  • @shoumitroray3062
    @shoumitroray3062 2 ปีที่แล้ว

    Please, Share your code. Thanks brother.

  • @laffe5788
    @laffe5788 8 หลายเดือนก่อน

    Hi again Tom! Seems like my replies dont go through on youtube. We are more than willing to pay for your help. Could you provide us with your preffered contact method, so we can discuss further?
    Best regards

    • @tomspythonanddjango6269
      @tomspythonanddjango6269  6 หลายเดือนก่อน

      Best way to get hold of me is by email. My email address is in setup.py

  • @rzr112
    @rzr112 ปีที่แล้ว

    video just literally saved me months of development and maintaining, You are awesome.
    I am experiencing error with DRF api URL, however.. Any way i can contact you?