Це відео не доступне.
Перепрошуємо.

Django Multiple Database Setup Ex1

Поділитися
Вставка
  • Опубліковано 19 сер 2024

КОМЕНТАРІ • 124

  • @PythonicPath1
    @PythonicPath1 3 роки тому +8

    any Django developer that doesn't know this channel is missing something , Thanks for this amazing videos !!

    • @veryacademy
      @veryacademy  3 роки тому

      Thanks Azzam 👍

    • @KodingTreecom
      @KodingTreecom 3 роки тому +2

      I just subscribed after reading this comment.

    • @uweopfern
      @uweopfern 2 роки тому +1

      Totally agree, this guy is an amazing django developer that I have ever seen

    • @felicytatomaszewska2934
      @felicytatomaszewska2934 Рік тому

      What this channel is missing?

  • @aaklii
    @aaklii 3 роки тому +21

    I am totally blown by the new variety of contents you are coming up with.
    I am thankful to you for efforts u are taking to make developers like me much skillful.

  • @robertfilson1917
    @robertfilson1917 3 роки тому +1

    I have been struggling with creating multiple databases and importing legacy databases that are read-only. This tutorial really helped me understand how routers work. Thank you very much for that. I will point anybody else who is struggling with it to this video.

  • @uweopfern
    @uweopfern 2 роки тому +1

    The best django developer on the planet, damn amazing

  • @andrewsmichael7047
    @andrewsmichael7047 2 роки тому

    This tutorial deserves an applause
    It have serve my time from MongoDB errors and with postresql relationship in the Django admin
    Thank you sir.

  • @gbrachetta
    @gbrachetta 3 роки тому +3

    Great!!. I wasn't aware of this until now. Congratulations for such an specialised channel. Definitely the one to go for Django-related content!

  • @vijaypandey9761
    @vijaypandey9761 3 роки тому +3

    Easy to understand and easy to implement. Thank you for the tutorial.

  • @abraaobb
    @abraaobb Рік тому

    Thank you so much for tutorial.

  • @backendmystery
    @backendmystery Рік тому

    Thanks, needed the explanations

  • @omarsarmientorolo4065
    @omarsarmientorolo4065 Рік тому +1

    Thanks for video... great job! Special for multi tenant architecture

  • @SrimalSamarasooriya
    @SrimalSamarasooriya 2 роки тому

    Man... Thank you for this... Keep sharing your Django wisdom...

  • @KrishnaManohar8021
    @KrishnaManohar8021 3 роки тому +1

    Thank you for considering my feedback. and waiting for the next video...

  • @rahulsaha2859
    @rahulsaha2859 3 роки тому +2

    yesterday faced an interview where they asked how you configure different db in django and here I am learnt how, now gonna crack the next. Thanks sir... also I am facing below issue ...
    ''ConnectionDoesNotExist at /admin/blue/blue/''

    • @veryacademy
      @veryacademy  3 роки тому

      Hi Rahul, well the very best of luck to you, I am sure you will get that job soon enough. Regarding the error, it is one of those it could be a few things, an incorrect name/typo or migrations out of sync or database config issues.

  • @EmileNani
    @EmileNani 2 роки тому

    This was very helpful, thank you. I wanted to use Django as an admin micro-service which this has helped me to do.

  • @mesakenavunawa8912
    @mesakenavunawa8912 2 роки тому +1

    Amazing content.

  • @Tauseef
    @Tauseef 3 роки тому

    Just to let you know you are doing a great job! Subscribed!!

  • @mrHuangEnglish
    @mrHuangEnglish 3 роки тому +1

    Wow! Wonderful material. Thank you so much!

  • @blackcoder9532
    @blackcoder9532 3 роки тому

    This video is very helpful to me thankyou for making this video😭

  • @mail4upendra
    @mail4upendra 3 роки тому +1

    Great Tuorial! Keep it up! Thank you 3000 :D

  • @atharvamishra4848
    @atharvamishra4848 3 роки тому +1

    settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
    even after adding 'session' and 'admin'

    • @킥갓
      @킥갓 3 роки тому

      I have same problem. Did u fix it? :(

  • @divitrao4296
    @divitrao4296 2 роки тому

    You bring really good content. Thank you

  • @oauth9728
    @oauth9728 3 роки тому +1

    Not viewing , but I trust the content!

  • @djangodeveloper07
    @djangodeveloper07 2 роки тому

    great video. any more video on this topic ?

  • @LocoARG
    @LocoARG 3 роки тому +1

    Thank You!!!!

  • @PankajSavaliyaGoogle
    @PankajSavaliyaGoogle 3 роки тому +1

    Very impressive, can you please release the next episode with foreign key, prefetch_releated, select_related and etc? Thanks, man!

    • @veryacademy
      @veryacademy  3 роки тому +2

      I was just a few hours ago thinking about how to extend this further - thank you.

    • @PankajSavaliyaGoogle
      @PankajSavaliyaGoogle 3 роки тому +1

      @@veryacademy 😂😂😂 see we're on same track.

  • @MrAntivirus66
    @MrAntivirus66 3 роки тому +1

    Hey good sir, first of all i want to thank you for all effort you are putting in :). i am making face recognition + django web app, so i am interested how to connect them, i am beginner, but i hope so i ll figure it out .

    • @veryacademy
      @veryacademy  3 роки тому +1

      You are the second person today regarding face recognition... I will get back into ML sooner than later! Thank you - good luck!

  • @alperakbash
    @alperakbash 2 роки тому

    Thank you so much for such a perfect tutorial. Is there any chance for a next video on testing with multiple databases?

  • @user-eq4lg5fg1f
    @user-eq4lg5fg1f 4 місяці тому

    too good

  • @mehranj73
    @mehranj73 3 роки тому +2

    Would you please make a video about atomic transactions?

    • @veryacademy
      @veryacademy  3 роки тому +1

      Hi Mehran, I will add to the suggestions. Thank you

    • @KrishnaManohar8021
      @KrishnaManohar8021 3 роки тому

      What it means exactly atomic transactions???

  • @yasayah7289
    @yasayah7289 2 роки тому

    Great content! Slightly different topic, but will you be providing a tutorial on RBAC or have you already?

  • @natarajanm4036
    @natarajanm4036 3 роки тому +1

    Could you please cover the High availability scenario . Lets say My DB's are hosted in two different Data Centre's . If one of the DB Server is failed the app should run with other DB Server in different DC. And if the failed DB has recovered it should sync with other DB .As soon as it came up.

  • @murishou
    @murishou 3 роки тому

    Awesome!

  • @harryabc1789
    @harryabc1789 2 роки тому +1

    Can you please make a tutorial about how to provide relationship between multiple database ?

  • @mosco225
    @mosco225 Рік тому +1

    Hello ❤ has you make a second part ?

  • @LouisAgyapong
    @LouisAgyapong 3 роки тому

    Great content.

  • @jaguarnet
    @jaguarnet 3 роки тому +1

    this is unique awesome content, such option drive everyone to think to use django for microservices, if we can split the project in multiple DBs, can we do the same and deploy the Application to multiple servers? if yes this will accomplish the theory of microservice , can we ?

    • @veryacademy
      @veryacademy  3 роки тому

      Hi Fahd, yes Django as the framework within microservices setup/architecture - we can do that. As per normal with any suggestion like this we would find 100 people for and and 100 people against doing so. Some would say this would be counter productive, unnecessarily or complicated. There would be some who would suggest with Django sticking with monolithic and deploy to multiple instances with for example a load balancer and hardware tuning. Who needs to learn microservices when we have serverless 😁👍

    • @jaguarnet
      @jaguarnet 3 роки тому

      @@veryacademy May you explain in little details what benefits I will get of being paid member of your channel as I can see all your videos are available along with resources

    • @veryacademy
      @veryacademy  3 роки тому +1

      @@jaguarnet Hi Fahd, research has revealed that spending money on others actually makes us happier than spending it on ourselves, and giving to others can actually make us healthier! There are no other tangible benefits for you or me subscribing to the members community. I will continue to produce free content. If google should provide more views or if I can gain a larger number of members, the associated financial rewards will enable me to increase the amount, quality and depth of tutorials on this platform. This is a not-for-profit service, all other monies gained will find its way back into producing more content and helping others to access education. I hope that you continue enjoying the content - thank you for your comments 👍

    • @jaguarnet
      @jaguarnet 3 роки тому +1

      @@veryacademy This is awesome from you wishing you very good luck I promise I will subscribe in case if I demanded on your excellent material more and if I were I would slightly change my strategy little and I will share more advanced topics to the paid subscribers and free medium level for the free subscribers whiching you very good luck at anyway :)

  • @gabycarrizal9395
    @gabycarrizal9395 2 роки тому +1

    maybe a dumb question, is mandatory to create multiple applications in order to use multiple connections? or is more like a good practice? sorry I'm new

    • @veryacademy
      @veryacademy  2 роки тому +1

      Never a dumb question. There is no mandatory. If I think I understand, make as many apps as you need. Ideally at least to start with stick with 1 database

  • @gulzarsingh716
    @gulzarsingh716 2 роки тому

    How to connect multiple legacy databases with tables in the same app? How to do migrations?

  • @jairajsahgal7101
    @jairajsahgal7101 2 роки тому +1

    Is there a way to manually select models for saving into different databases?

    • @veryacademy
      @veryacademy  2 роки тому

      Hey, models in django refers to tables. Are you asking me how to define which model should be saved in which database?

    • @jairajsahgal7101
      @jairajsahgal7101 2 роки тому

      @@veryacademy Yes, sorry for poor english. I tried routers method but it would create all the tables inside my default database.

  • @tamirtsogbayar3912
    @tamirtsogbayar3912 2 роки тому

    Hello thanks for this tutorial
    Pls help me i use mongodb as second db then i stuck how to write router for mongodb

  • @3DGFan9000
    @3DGFan9000 2 роки тому

    not sure whats going on with mine. I have an AuthRouter, and one called DeliveryRouter. When i migrate database=deliveries_db it brings in all of the auth tables as well, and the other way when i migrate users_db. If I do standard migrate it puts tables from my delivery app on the default database. Looks identical to what you demoed.

  • @NeraJima
    @NeraJima 3 роки тому +1

    When creating a custom user model, we must do user.save(using=self._db). Would we do user.save(using=self.users_db) if our custom database's name is users like the case in this video?

    • @veryacademy
      @veryacademy  3 роки тому +1

      Don't need self just the _db

  • @narmindm
    @narmindm 2 роки тому +1

    Hi, a very cool lesson!1 Thank you! Can you tell me, please, the django_migrations file is created in all databases, and it is the same, is it possible to avoid this behavior?7 For example, I have an additional step to change the table, but I don't have access to create a new table, what should I do?

    • @veryacademy
      @veryacademy  2 роки тому +1

      Migrate first and change the migration file before makemigrations

    • @narmindm
      @narmindm 2 роки тому

      Thanks!! I will try to do this

  • @rangarajann1781
    @rangarajann1781 2 роки тому

    How to use different schemas in a single database in django?

  • @developers_hub
    @developers_hub 2 роки тому

    How can we define relationship between tables in different databases ? Django has no built in support for that, But says can fake the cross connection. How can we achieve this ?

  • @vaibhavlodha1560
    @vaibhavlodha1560 3 роки тому +1

    How will be manage test cases which uses particular db?

    • @veryacademy
      @veryacademy  3 роки тому

      Great question.
      docs.djangoproject.com/en/3.2/topics/testing/tools/#multi-database-support
      look for Multi-database support

  • @sunagshetty9279
    @sunagshetty9279 2 роки тому

    Thanks for this valuable information, i have one requirement, in a existing project with default data base configuration, please note data base has many tables, what i have to do to create a new data base for future applications we create in that project. in a nutshell i want a extra data base configuration without altering default case, as data base is filled with many data, please help here.

  • @HDKHKhmer
    @HDKHKhmer 2 роки тому

    I have User.db in Mysql(database 1) and Product.db in postgres (database 2 ) . How to connecting both database and relationship ?

  • @smitpanchal9866
    @smitpanchal9866 Рік тому

    How can I set FK for multiple database?

  • @VijayKumar-dq3ph
    @VijayKumar-dq3ph 2 роки тому

    Nice vedio! could you please tell how to implement cross database relationships? Any hints?

  • @noblessetech
    @noblessetech 2 роки тому +1

    Django doesn't support relation between different databases so what's the point of using this?

    • @veryacademy
      @veryacademy  2 роки тому +1

      When you have more than one database that doesn't depend on relational support

  • @jorisjansen2892
    @jorisjansen2892 2 роки тому +1

    Great tutorial! How would you create relations between models in different databases? Or would you store a reference on a model such as a user_id field, which the user would send with the JWT token, to look for user-specific objects? Cheers

    • @ganeshniranjan895
      @ganeshniranjan895 Рік тому

      I am looking for the same ... have you found any solution regarding this

    • @jorisjansen2892
      @jorisjansen2892 Рік тому

      @@ganeshniranjan895 You should store a reference. It's impossible to have relations between different databases. So storing a user_id or user_uuid would be preferred. Good luck!

    • @ganeshniranjan895
      @ganeshniranjan895 Рік тому

      @@jorisjansen2892 Thank you brother & one last thing i'm using Postgres, so, is it okay if i create the view of user in another db ... will it work ... any suggestions

    • @jorisjansen2892
      @jorisjansen2892 Рік тому

      @@ganeshniranjan895 not sure what you mean with ‘view of user’. Could you please elaborate?

    • @ganeshniranjan895
      @ganeshniranjan895 Рік тому

      @@jorisjansen2892 It is kind of a pseudo-table, these are not real tables take it has a copy of the auth_user table in this case

  • @Julian-uy9jh
    @Julian-uy9jh 3 роки тому

    my admin add new object, and clicking on specific object do not work in admin GUI. Deleting an object works though. It says settings.DATABASES is improperly configured. Does anyone know why?

  • @fowad27
    @fowad27 2 роки тому

    Great video, but what's the purpose of having multiple databases rather than tables within one database?

  • @felicytatomaszewska2934
    @felicytatomaszewska2934 Рік тому +1

    The word is ROUTER not ROOTAR 😂😂 It is so funny

  • @stringconsultants2645
    @stringconsultants2645 3 роки тому

    I connected multiple database using multiple djangoApplication but Join is not working ,One particular application model class
    i try to use same application but another class model getting error (1146, "Table 'coinvest.tbl_positiontest' doesn't exist").
    its connect another database i need support any one help me ....

  • @hosseintaheri9019
    @hosseintaheri9019 3 роки тому +1

    thanks sir , is it possible to make relations between tables from different databases ? imagine having two dbs : shop_db and auth_db ,
    I created an app called accounts and defined my custom User that inherits from AbstractUser then I migrated it into auth_db ,
    then I created an app called orders and defined an Order model in it , it has a ForeinKey relation to my custom User model , then I migrated Order into shop_db ,
    but when I try to assign a user to an order in admin I get this error : no such table: main.accounts_user

    • @veryacademy
      @veryacademy  3 роки тому +2

      Hmm that would be a good tutorial 👍

    • @hosseintaheri9019
      @hosseintaheri9019 3 роки тому

      @@veryacademy 🙏🙏❤️❤️

    • @jorisjansen2892
      @jorisjansen2892 2 роки тому

      @@veryacademy This was my question as well, would be awesome if you could create a video about this!!

  • @natarajanm4036
    @natarajanm4036 3 роки тому +1

    100th Like

  • @Jakub1989YTb
    @Jakub1989YTb 3 роки тому

    Can you have foreign keys between the modles living in different databases?

    • @veryacademy
      @veryacademy  3 роки тому

      Hi Jakub, if you are referring to FK to FK relationships
      stackoverflow.com/questions/29528323/can-a-foreign-key-reference-another-foreign-key/29571740

  • @aakashmania
    @aakashmania Рік тому

    I am getting module router not found error , can anyone help me !

  • @olb47
    @olb47 3 роки тому

    ModuleNotFoundError: No module names 'routers' - what could be the cause?

    • @veryacademy
      @veryacademy  3 роки тому

      Are you following this tutorial only or adding to an existing project

    • @olb47
      @olb47 3 роки тому

      @@veryacademy adding to the existing project

    • @aakashmania
      @aakashmania Рік тому

      Same error , did your error got solved ?

    • @SofiaParker777
      @SofiaParker777 11 місяців тому

      ​@aakashmania3784 did you find the solution ?

  • @AcademyOmen
    @AcademyOmen 3 роки тому +1

    💃💃💃💃Router

  • @wobblyjellyman69
    @wobblyjellyman69 3 роки тому

    router? I hardly know 'er!

  • @kevinzettel
    @kevinzettel 2 роки тому +1

    the biggest Issue is the admin isn't hooked up to the two remote databases and using the remote databases table it's using it's local table. as such I think this is pointless which you just did and I'm pretty sure after researching for hours that Django can't support the admin table with multiple databases. either don't use the admin table or don't use multiple databases.

    • @veryacademy
      @veryacademy  2 роки тому

      Can I just confirm. You would like to see 2 databases used on one admin site. Is that correct.

    • @kevinzettel
      @kevinzettel 2 роки тому

      ​@@veryacademy No I found out that you just have to use the "default". one admin DB and one app db and the admin db must be use the default database. something that took me forever to figure out was the admin.model to connect them. figured it out like 3 hours ago and it's actually really nice with optional admin configurations.

  • @omarsarmientorolo4065
    @omarsarmientorolo4065 Рік тому +1

    Thanks for video... great job! Special for multi tenant architecture

  • @dexterfortsilva6656
    @dexterfortsilva6656 Рік тому

    can you make a new tutorial of this with relations like a user on the first db and bank on the other db and user can add a bank acc based on the second db