Django Multiple Database Setup Ex1

  Рет қаралды 37,323

Very Academy

Very Academy

Күн бұрын

Пікірлер: 124
@PythonicPath1
@PythonicPath1 3 жыл бұрын
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 жыл бұрын
I just subscribed after reading this comment.
@uweopfern
@uweopfern 2 жыл бұрын
Totally agree, this guy is an amazing django developer that I have ever seen
@felicytatomaszewska
@felicytatomaszewska Жыл бұрын
What this channel is missing?
@aaklii
@aaklii 3 жыл бұрын
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.
@veryacademy
@veryacademy 3 жыл бұрын
It's my pleasure 👍
@robertfilson1917
@robertfilson1917 3 жыл бұрын
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.
@veryacademy
@veryacademy 3 жыл бұрын
Glad it helped!
@andrewsmichael7047
@andrewsmichael7047 3 жыл бұрын
This tutorial deserves an applause It have serve my time from MongoDB errors and with postresql relationship in the Django admin Thank you sir.
@uweopfern
@uweopfern 2 жыл бұрын
The best django developer on the planet, damn amazing
@gbrachetta
@gbrachetta 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!
@veryacademy
@veryacademy 3 жыл бұрын
Thanks a lot!
@vijaypandey9761
@vijaypandey9761 3 жыл бұрын
Easy to understand and easy to implement. Thank you for the tutorial.
@veryacademy
@veryacademy 3 жыл бұрын
You are welcome!
@rahulsaha2859
@rahulsaha2859 3 жыл бұрын
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.
@omarsarmientorolo4065
@omarsarmientorolo4065 Жыл бұрын
Thanks for video... great job! Special for multi tenant architecture
@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.
@KrishnaManohar8021
@KrishnaManohar8021 3 жыл бұрын
Thank you for considering my feedback. and waiting for the next video...
@veryacademy
@veryacademy 3 жыл бұрын
👍
@SrimalSamarasooriya
@SrimalSamarasooriya 2 жыл бұрын
Man... Thank you for this... Keep sharing your Django wisdom...
@atharvamishra4848
@atharvamishra4848 3 жыл бұрын
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? :(
@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?
@PankajSavaliyaGoogle
@PankajSavaliyaGoogle 3 жыл бұрын
Very impressive, can you please release the next episode with foreign key, prefetch_releated, select_related and etc? Thanks, man!
@veryacademy
@veryacademy 3 жыл бұрын
I was just a few hours ago thinking about how to extend this further - thank you.
@PankajSavaliyaGoogle
@PankajSavaliyaGoogle 3 жыл бұрын
@@veryacademy 😂😂😂 see we're on same track.
@Tauseef
@Tauseef 3 жыл бұрын
Just to let you know you are doing a great job! Subscribed!!
@MrAntivirus66
@MrAntivirus66 3 жыл бұрын
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 жыл бұрын
You are the second person today regarding face recognition... I will get back into ML sooner than later! Thank you - good luck!
@mehranj73
@mehranj73 3 жыл бұрын
Would you please make a video about atomic transactions?
@veryacademy
@veryacademy 3 жыл бұрын
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?
@blackcoder9532
@blackcoder9532 3 жыл бұрын
This video is very helpful to me thankyou for making this video😭
@harryabc1789
@harryabc1789 3 жыл бұрын
Can you please make a tutorial about how to provide relationship between multiple database ?
@mrHuangEnglish
@mrHuangEnglish 3 жыл бұрын
Wow! Wonderful material. Thank you so much!
@veryacademy
@veryacademy 3 жыл бұрын
Thank you!
@djangodeveloper07
@djangodeveloper07 2 жыл бұрын
great video. any more video on this topic ?
@abraaobb
@abraaobb Жыл бұрын
Thank you so much for tutorial.
@backendmystery
@backendmystery Жыл бұрын
Thanks, needed the explanations
@natarajanm4036
@natarajanm4036 3 жыл бұрын
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.
@divitrao4296
@divitrao4296 3 жыл бұрын
You bring really good content. Thank you
@mail4upendra
@mail4upendra 3 жыл бұрын
Great Tuorial! Keep it up! Thank you 3000 :D
@veryacademy
@veryacademy 3 жыл бұрын
Thank you too!
@mesakenavunawa8912
@mesakenavunawa8912 2 жыл бұрын
Amazing content.
@veryacademy
@veryacademy 2 жыл бұрын
Glad you think so!
@oauth9728
@oauth9728 3 жыл бұрын
Not viewing , but I trust the content!
@veryacademy
@veryacademy 3 жыл бұрын
👍
@fowad27
@fowad27 2 жыл бұрын
Great video, but what's the purpose of having multiple databases rather than tables within one database?
@jaguarnet
@jaguarnet 3 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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 :)
@narmindm
@narmindm 2 жыл бұрын
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 жыл бұрын
Migrate first and change the migration file before makemigrations
@narmindm
@narmindm 2 жыл бұрын
Thanks!! I will try to do this
@mosco225
@mosco225 Жыл бұрын
Hello ❤ has you make a second part ?
@veryacademy
@veryacademy Жыл бұрын
Not yet!
@gabycarrizal9395
@gabycarrizal9395 2 жыл бұрын
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 жыл бұрын
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
@VijayKumar-dq3ph
@VijayKumar-dq3ph 2 жыл бұрын
Nice vedio! could you please tell how to implement cross database relationships? Any hints?
@sunagshetty9279
@sunagshetty9279 3 жыл бұрын
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.
@jorisjansen2892
@jorisjansen2892 3 жыл бұрын
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 2 жыл бұрын
I am looking for the same ... have you found any solution regarding this
@jorisjansen2892
@jorisjansen2892 2 жыл бұрын
@@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 2 жыл бұрын
@@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 2 жыл бұрын
@@ganeshniranjan895 not sure what you mean with ‘view of user’. Could you please elaborate?
@ganeshniranjan895
@ganeshniranjan895 2 жыл бұрын
@@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
@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.
@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 ?
@jairajsahgal7101
@jairajsahgal7101 2 жыл бұрын
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.
@NeraJima
@NeraJima 3 жыл бұрын
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 жыл бұрын
Don't need self just the _db
@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
@gulzarsingh716
@gulzarsingh716 2 жыл бұрын
How to connect multiple legacy databases with tables in the same app? How to do migrations?
@LocoARG
@LocoARG 3 жыл бұрын
Thank You!!!!
@veryacademy
@veryacademy 3 жыл бұрын
👍
@vaibhavlodha1560
@vaibhavlodha1560 3 жыл бұрын
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
@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
@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 ?
@rangarajann1781
@rangarajann1781 2 жыл бұрын
How to use different schemas in a single database in django?
@noblessetech
@noblessetech 2 жыл бұрын
Django doesn't support relation between different databases so what's the point of using this?
@veryacademy
@veryacademy 2 жыл бұрын
When you have more than one database that doesn't depend on relational support
@smitpanchal9866
@smitpanchal9866 Жыл бұрын
How can I set FK for multiple database?
@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?
@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
@murishou
@murishou 3 жыл бұрын
Awesome!
@hosseintaheri9019
@hosseintaheri9019 3 жыл бұрын
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 жыл бұрын
Hmm that would be a good tutorial 👍
@hosseintaheri9019
@hosseintaheri9019 3 жыл бұрын
@@veryacademy 🙏🙏❤️❤️
@jorisjansen2892
@jorisjansen2892 3 жыл бұрын
@@veryacademy This was my question as well, would be awesome if you could create a video about this!!
@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 ....
@aakashmania
@aakashmania Жыл бұрын
I am getting module router not found error , can anyone help me !
@YadavAjay-f6u
@YadavAjay-f6u 6 ай бұрын
too good
@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 Жыл бұрын
​@aakashmania3784 did you find the solution ?
@kevinzettel
@kevinzettel 2 жыл бұрын
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.
@felicytatomaszewska
@felicytatomaszewska Жыл бұрын
The word is ROUTER not ROOTAR 😂😂 It is so funny
@veryacademy
@veryacademy Жыл бұрын
lol Thank you
@wobblyjellyman69
@wobblyjellyman69 3 жыл бұрын
router? I hardly know 'er!
@natarajanm4036
@natarajanm4036 3 жыл бұрын
100th Like
@veryacademy
@veryacademy 3 жыл бұрын
That is like amazing 👍
@AcademyOmen
@AcademyOmen 3 жыл бұрын
💃💃💃💃Router
@veryacademy
@veryacademy 3 жыл бұрын
😜
@omarsarmientorolo4065
@omarsarmientorolo4065 Жыл бұрын
Thanks for video... great job! Special for multi tenant architecture
@LouisAgyapong
@LouisAgyapong 3 жыл бұрын
Great content.
@veryacademy
@veryacademy 3 жыл бұрын
👍
Django Transaction Atomicity
12:56
Very Academy
Рет қаралды 20 М.
Officer Rabbit is so bad. He made Luffy deaf. #funny #supersiblings #comedy
00:18
Funny superhero siblings
Рет қаралды 16 МЛН
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 73 МЛН
Worst flight ever
00:55
Adam W
Рет қаралды 39 МЛН
How to get Django Tenants up and running
27:12
Tom's Python and Django
Рет қаралды 20 М.
How to Connect Django Project to Already Existing Database
24:00
Learn Django in 20 Minutes!!
21:25
Tech With Tim
Рет қаралды 380 М.
django Architecture - Connection Management
15:10
Hussein Nasser
Рет қаралды 48 М.
SQLAlchemy: The BEST SQL Database Library in Python
16:39
ArjanCodes
Рет қаралды 73 М.
Python Django Inheritance Optimisation Exercise
52:56
Very Academy
Рет қаралды 13 М.
Saving Pandas DataFrame to Django Model
32:16
Very Academy
Рет қаралды 22 М.
Officer Rabbit is so bad. He made Luffy deaf. #funny #supersiblings #comedy
00:18
Funny superhero siblings
Рет қаралды 16 МЛН