How to Connect Django Project to Already Existing Database

  Рет қаралды 60,580

KenBroTech

KenBroTech

Күн бұрын

Пікірлер: 91
@hommastonlimited3187
@hommastonlimited3187 2 жыл бұрын
very lucid and straight to the point. 100 percent on point
@albertoromero1588
@albertoromero1588 Жыл бұрын
Thanks a lot! so easy... I was trying some times but, i can´t do it. After your video all is well. Greetings from Mexico City.
@fatihcakular
@fatihcakular Жыл бұрын
Thanks to you, I was able to find the solution I was looking for.
@Gorlung
@Gorlung 3 жыл бұрын
Brilliant! One more video on the channel and again exactly I was looking for!
@SandeepKumar-ik1he
@SandeepKumar-ik1he 2 жыл бұрын
Thank you sir your effort is beneficial for a beginner
@for41
@for41 3 жыл бұрын
thank you so much! this is exactly what I was looking for. very clean explanation. love it. wish you only the best!!!
@nikhilshikare8182
@nikhilshikare8182 2 жыл бұрын
Thank-You Sir , After lot of searching and watching finally found this. this is exact i am searching for
@KenBroTech
@KenBroTech 2 жыл бұрын
I'm glad you found this helpful
@therumbekans7944
@therumbekans7944 9 ай бұрын
Thanks man! Wow ....doing my second yewr project and this is wow
@SahPhoenix
@SahPhoenix 2 жыл бұрын
EXACTLY what I needed, 10/10 thank you
@ya00278
@ya00278 3 жыл бұрын
Can't thank you enough! Very clear explanations and helped me a lot. wish you all the best!
@KenBroTech
@KenBroTech 3 жыл бұрын
Glad it helped!
@Davidkiania
@Davidkiania 2 жыл бұрын
This is splendid work my brother from Accra have several DBs I want to Djangofy 👏🏾👏🏾
@KenBroTech
@KenBroTech 2 жыл бұрын
Big up
@justflybluesky
@justflybluesky 3 жыл бұрын
Well done mate. In the official Django documentation I was missing exactly the connection of an existing SQL db to a django project.
@requestmusekwa8757
@requestmusekwa8757 Жыл бұрын
this is very usefull bro..
@henrykpano1715
@henrykpano1715 2 жыл бұрын
Great tutorials. I was looking for this. Thanks
@deshi4722
@deshi4722 11 ай бұрын
WOnderful, very very thank you SIr
@TN61GAMER
@TN61GAMER Жыл бұрын
It's really helpful for me🎉😊
@lenikki6348
@lenikki6348 3 жыл бұрын
Thank you for this. I've been searching for this didn't find any answer.
@aniketsaha7273
@aniketsaha7273 Жыл бұрын
Exactly what I needed thanks alot
@adassb2999
@adassb2999 2 жыл бұрын
excellent video , many thanksss
@asgeralia8802
@asgeralia8802 2 жыл бұрын
superb superb superb sir
@princesamuel100
@princesamuel100 2 жыл бұрын
This is very useful Ken. Thanks soo much.
@KenBroTech
@KenBroTech 2 жыл бұрын
You are very welcome
@tlideas
@tlideas Жыл бұрын
amazing tutorial ever. thanks you man
@KenBroTech
@KenBroTech Жыл бұрын
Glad you liked it!
@md.rahimuddin1738
@md.rahimuddin1738 8 ай бұрын
Thanks brother, Just amazing
@KenBroTech
@KenBroTech 7 ай бұрын
Glad you liked it!
@asgeralia8802
@asgeralia8802 2 жыл бұрын
Superb sir, pls help in crud operations
@BERTDELASPEED
@BERTDELASPEED 3 жыл бұрын
Great content and very well explained, Thanks a lot
@axelamoe
@axelamoe Жыл бұрын
Great video
@bensonsaju9533
@bensonsaju9533 2 жыл бұрын
thanks alot bro..this was so helpfull
@KenBroTech
@KenBroTech 2 жыл бұрын
Glad it helped
@ThegreatestVN
@ThegreatestVN 2 жыл бұрын
Hi Ken, I am running in to an error unfortunately, it says "Did you install mysqlclient?" after i connected everything, what should I do, should i pip install mysqlclient?
@AttilioBongiorni
@AttilioBongiorni 2 жыл бұрын
Thank you, very good tutorial!
@KenBroTech
@KenBroTech 2 жыл бұрын
Glad it was helpful!
@moviewithdan4499
@moviewithdan4499 2 жыл бұрын
thank you ... helped me alot
@shubhsingh1138
@shubhsingh1138 3 жыл бұрын
Thanks a lot for this video.
@KenBroTech
@KenBroTech 3 жыл бұрын
You are most welcome
@JesudhasXavierJ
@JesudhasXavierJ Жыл бұрын
Hi, can you please make a video for connecting a secondary db which is already exist
@redrum4486
@redrum4486 2 жыл бұрын
this is perfect!! you da man bro
@KenBroTech
@KenBroTech 2 жыл бұрын
Glad it helped!
@redrum4486
@redrum4486 2 жыл бұрын
@@KenBroTech I have 1 issue, some of the tables in my second database do not have a parimary key column so I have having trouble accessing them via admin panel, what could I do? As the django docs state that each model should have at least 1 primary key
@pavanbaswani2454
@pavanbaswani2454 Жыл бұрын
Will it update the records in the phpmyadmin too??? I got confused that you use the localhost/admin page to create a user, will the database is in sync (if you update in admin page will it be affected in phpmyadmin page?)
@natural8471
@natural8471 2 жыл бұрын
Thank you! Really helpful!!!
@khurramkhan5606
@khurramkhan5606 2 жыл бұрын
what if i want to autoamte this tables like i have to connect user's database and for which i don't actually know the quantity and names of table then?
@vishalmhatre1731
@vishalmhatre1731 11 ай бұрын
Does in django primary key should always be id or we can name anything
@moritzstecher7364
@moritzstecher7364 2 жыл бұрын
Very helpful, thank you!!
@sweethouse2773
@sweethouse2773 2 жыл бұрын
what should you do when you have images or static files linked to your db
@oparesimon
@oparesimon 3 жыл бұрын
Kudos
@michaelfields7296
@michaelfields7296 2 жыл бұрын
Will creating models mess up my views or templates I have for my html pages?
@KenBroTech
@KenBroTech 2 жыл бұрын
This video offers solution to a specific instance where a database system already exists and you want to integrate it into your Django project. This will not affect your views or template in anyway. All you need to be mindful are the names you used in the models and make them reflect when you write them in the views.
@xtremedestroyer9241
@xtremedestroyer9241 Жыл бұрын
you're a fucking top G brother! Thank you very much for this easy to follow video!
@Sergeika1000
@Sergeika1000 Жыл бұрын
I did not understand where in the config the name of the table Students was written?
@gulzarsingh716
@gulzarsingh716 2 жыл бұрын
How to connect multiple legacy databases with tables in the same app?
@cheerio4742
@cheerio4742 2 жыл бұрын
What if the Database is update like new tables has been added, do I need to inspectdb again?
@KenBroTech
@KenBroTech 2 жыл бұрын
yes, but I think after the initial connection to the existing database, any other updates will be done via the models.py
@wanheda-codm7685
@wanheda-codm7685 Жыл бұрын
you saved me
@omarnaitelhaj4446
@omarnaitelhaj4446 2 жыл бұрын
Thanks ❤️❤️
@KenBroTech
@KenBroTech 2 жыл бұрын
You're welcome 😊
@hommastonlimited3187
@hommastonlimited3187 2 жыл бұрын
I wished you had a tutorial on how to import excel files into django
@kamakshitrivedi8561
@kamakshitrivedi8561 3 жыл бұрын
Can you please make a similar video for alreading existing mongodb database? Please..
@pinakityagi3638
@pinakityagi3638 11 ай бұрын
when using the inspect command for mongodb database it's not working
@ashokthegamer3439
@ashokthegamer3439 2 жыл бұрын
Character field data fetching is ok. But imagefield is not fetching the data and not return to html page How could i do
@anithasshenoy6662
@anithasshenoy6662 2 жыл бұрын
Great tutorial. However no matter I do I can't seem to get data on the webpage. The context send to the html page is not reading on it. What could be the reason ?
@KenBroTech
@KenBroTech 2 жыл бұрын
Anitha, please I am unable to understand your question very well. Kindly let me understand and I will be glad to assist you
@anithasshenoy6662
@anithasshenoy6662 2 жыл бұрын
@@KenBroTech I think if you see my code you shall understand better. Models.py from django.db import models class Cities(models.Model): cities_id = models.AutoField(primary_key=True) citiesname = models.CharField(db_column='citiesname', max_length=100) citiescol = models.CharField(db_column='citiescol', max_length=45, blank=True, null=True) class Meta: managed = False db_table = 'cities' views.py rom django.shortcuts import render from .models import Cities # Create your views here. def hi(request): return render(request, 'eshops/main.html') def hi1(request): cty=Cities.objects.all() content={ 'ctname': cty.citiesname } return render(request, 'eshops/mntop.html',{'di': content}) Here typing cty. do not show any of the column objects in the table Cities The html page displays error msg "'QuerySet' object has no attribute 'citiesname'" Sometimes the page displays "django.db.models.query_utils.DeferredAttribute object at 0x0000000003F9F0D0" error msg. Absolutely stuck now for the 2nd day. Can you identify what I am doing wrong ? cty=Cities.objects.all() displays a warning Unresolved attribute reference 'object' for class 'Cities' if I enter Objects=None in the models.py inside the Cities class, this warning goes away. But nothing else changes.
@anithasshenoy6662
@anithasshenoy6662 2 жыл бұрын
After watching your video again, I have modified the views.py and the html page as def hi1(request): city = Cities.objects.all() context = { 'city': Cities } return render(request, 'eshops/mntop.html', context) and the html page modified thus {{ city.citiesname }} However on running, the html page do not display anything. It simply displays a blank tag. Means no data from the table passes to the html page. In fact I noticed that while typing {{ city. }} the column names do not appear as popdown list like when you where typing. This shows city do not contain any objects from the Cities. And pyCharm displays "Unresolved attribute reference 'objects' for class 'Cities' . This could be the reason why context is not passing any data from the table. Some blogs tell adding objects = models.manager() solves this issue. But when I tried it, it gave another error that .manager cannot called. I wonder how it works in your system ?
@KenBroTech
@KenBroTech 2 жыл бұрын
Hi Anitha, if this is exactly what you have typed: def hi1(request): city = Cities.objects.all() context = { 'city': Cities } return render(request, 'eshops/mntop.html', context) then you need to change the value Cities inside your context dictionary to city. So your context dictionary will look like context ={ 'city': city }
@anithasshenoy6662
@anithasshenoy6662 2 жыл бұрын
@@KenBroTech Thank you so much. finally I could make it.
@vaishnavideshmukh5194
@vaishnavideshmukh5194 3 жыл бұрын
I am getting an error whenever I m importing a Class from models to the views I get this error "ValueError: source code string cannot contain null bytes" Even tho I don't have any null values . Can you please help. Thankyou
@idedhica
@idedhica 3 жыл бұрын
i got an error when i want to runserver. "You have 1 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): UserApi. Run 'python manage.py migrate' to apply them."... when i apply migrations it show that relations table already exist
@KenBroTech
@KenBroTech 3 жыл бұрын
Kindly run python manage.py makemigrations then later run python manage.py migrate
@daiphuc5357
@daiphuc5357 3 жыл бұрын
thanks very much
@KenBroTech
@KenBroTech 3 жыл бұрын
Always welcome
@diegofoca7664
@diegofoca7664 3 жыл бұрын
Thank you so much
@KenBroTech
@KenBroTech 3 жыл бұрын
You're most welcome
@juanda4269
@juanda4269 2 жыл бұрын
Thank you!
@Namastedbt
@Namastedbt 3 жыл бұрын
Thanks 👍
@KenBroTech
@KenBroTech 3 жыл бұрын
Welcome 👍
@josealvarezmendoza5448
@josealvarezmendoza5448 3 жыл бұрын
when i run the page, django gives me an error who says " No such column: Prueba.id" mi classname is prueba. I dont know how to fix this error it seems like django creates a new column for the id. And trust me i do step by step like in your video.
@KenBroTech
@KenBroTech 3 жыл бұрын
Kindly give me a proper context to the error you get so I can assist you
@jbailey130
@jbailey130 7 ай бұрын
I like you
@mahmudoduoye7391
@mahmudoduoye7391 3 жыл бұрын
Bravo!
@oparesimon
@oparesimon 3 жыл бұрын
Monitoring 24/7
@KenBroTech
@KenBroTech 3 жыл бұрын
Thanks bro. The projects I have for tomorrow and Thursday will excite you more
@oparesimon
@oparesimon 3 жыл бұрын
@@KenBroTech look forward to bro.
@Noritoshi-r8m
@Noritoshi-r8m 2 жыл бұрын
Thank you so much!!! Helped a lot
@KenBroTech
@KenBroTech 2 жыл бұрын
You're welcome!
Django Multiple Database Setup Ex1
32:52
Very Academy
Рет қаралды 37 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 219 М.
Watch This Before Using Django With MongoDB
9:18
Dennis Ivy
Рет қаралды 45 М.
you need to learn SQL RIGHT NOW!! (SQL Tutorial for Beginners)
24:25
NetworkChuck
Рет қаралды 1,6 МЛН
Django Tutorial for Beginners - Build Powerful Backends
1:02:36
Programming with Mosh
Рет қаралды 2,7 МЛН
Git Tutorials for Beginners
27:26
KenBroTech
Рет қаралды 2,6 М.
Python Django Mysql - CRUD Example Part 1 - Create and Insert in Mysql Database
26:47
Techlearners By Neeraj Saxena
Рет қаралды 34 М.
Easiest Way To Connect Django To A Postgres Database
7:28
Dennis Ivy
Рет қаралды 91 М.