Тёмный

Fetch Data From a Database And Output To A Webpage - Django Wednesdays #5 

Codemy.com
Подписаться 229 тыс.
Просмотров 96 тыс.
50% 1

In this video I'll show you how to fetch data from the database and output it onto a web page with Django and Python.
Our Database model has an Event Class, Venue Class, and MyClubUsers Class; and all three of those models are linked together with foreign keys and manytomany fields. So we can query one (the Event Class) and gain access to all of that information.
In this video we'll create and Events webpage that will query the Event Class of our database and pull out all the current planned Events and output them onto the web page! It's super easy!
Timecodes
0:00​ - Introduction
1:31 - Create an Events Webpage
2:11 - Create a URL Path For Events Page
2:45 - Create a View for Events Page and Query Database
5:00 - Output Events Data To Webpage
5:58 - Add Link To Events Page On Navbar
6:48 - Loop Thru Database Data On Webpage
7:53 - Access All Items In Event Class
10:21 - Access The MyClubUser Class Items
12:44 - Access The Venue Class Items
14:44 - Add Bootstrap Cards to Webpage
18:05 - Conclusion

Опубликовано:

 

30 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 108   
@Codemycom
@Codemycom 3 года назад
▶️ Watch Entire Django Wednesdays Playlist ✅ Subscribe To My RU-vid Channel: bit.ly/35Xo9jD bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
@dohnot
@dohnot 3 года назад
This is so cool and super easy, if you know what to do. I'm learning so much from your videos!
@Codemycom
@Codemycom 3 года назад
Awesome! Thank you!
@DerekStevens
@DerekStevens 3 года назад
This was exactly what I was looking for! Thanks again.
@Codemycom
@Codemycom 3 года назад
Glad I could help!
@yeabayu6434
@yeabayu6434 Год назад
I m just a bigginer with python but you just made django more than fun to me. Man u r amazing
@Codemycom
@Codemycom Год назад
Glad you're enjoying it!!
@spencebuzz9220
@spencebuzz9220 3 года назад
Hey thank you for uploading these, I really enjoy your python videos.
@Codemycom
@Codemycom 3 года назад
Glad you like them!
@DevanshChopra-ym8zt
@DevanshChopra-ym8zt 2 года назад
thanks a lot, this video was really well made, I was able to understand everything even though I am a beginner
@Codemycom
@Codemycom 2 года назад
Glad it helped!
@timurdjumaniyazov9392
@timurdjumaniyazov9392 8 месяцев назад
When you show how to use - awesome! Django is going to easy! Thank you very much!
@Codemycom
@Codemycom 8 месяцев назад
Welcome!
@fadyghalayiny1920
@fadyghalayiny1920 3 года назад
thanks for the great video hope you will dig deeper in manytomany and make a video about tabular inline in the admin
@sachinsinghal13
@sachinsinghal13 3 года назад
Thanks, Another Great Video as Always
@Codemycom
@Codemycom 3 года назад
Glad you enjoyed it
@alcidesmarcano
@alcidesmarcano 3 года назад
Great content! As always...
@Codemycom
@Codemycom 3 года назад
Much appreciated!
@navnav1819
@navnav1819 7 месяцев назад
Great video man, very helpful!
@Codemycom
@Codemycom 7 месяцев назад
Glad you enjoyed it!
@deki90to
@deki90to 3 года назад
It's just matter of time when this channel will explode and became super famous
@Codemycom
@Codemycom 3 года назад
Hope so!
@mantvydastautkus6748
@mantvydastautkus6748 3 года назад
really nice and informative , maybe next time you can make python window little wider so we can see entire code at once ?
@Codemycom
@Codemycom 3 года назад
Thanks! No, this is how I do it.
@rishirajvishwakarma1035
@rishirajvishwakarma1035 3 года назад
this Video is really Useful
@Codemycom
@Codemycom 3 года назад
Glad you liked it!
@anvarmexmonov2680
@anvarmexmonov2680 Год назад
Thank you from UZBEKISTAN
@Codemycom
@Codemycom Год назад
You're welcome from Las Vegas ;-)
@yasayah7289
@yasayah7289 2 года назад
Excellent content thank you!!! EDIT: I just previewed #6 and it appears you're covering some of the items below. :) Could you show how to add functionality for users that are event coordinators? Ex. Coordinators can filter their view of events/venues by - All', Approved', Pending', Location', Activity', I'm associated with'. Additionally, they receive an email notification when an event is approved, maybe only certain aspects of the event receive approval, requiring them to log back in, make the edits and resubmit for approval. Great series thank you for sharing your knowledge and experience!!!
@Codemycom
@Codemycom 2 года назад
Noted
@partialcoder6386
@partialcoder6386 Год назад
@@Codemycom yes please we want to learn as he stated
@hamzarami162
@hamzarami162 Год назад
thank you 💯💯
@i_shelyy
@i_shelyy 2 года назад
Really hard work❤️
@Codemycom
@Codemycom 2 года назад
thanks
@learnwithnawf246
@learnwithnawf246 3 года назад
Cheers✌️
@Codemycom
@Codemycom 3 года назад
:-)
@seeemawn
@seeemawn 2 года назад
thank you sir!
@Codemycom
@Codemycom 2 года назад
You are welcome!
@eduardocardoso6286
@eduardocardoso6286 Год назад
hey, thanks for the videos, it helped me a lot! do you have an exemple where you use existing tables ?
@Codemycom
@Codemycom Год назад
you mean a database you imported externally? no.
@Codemycom
@Codemycom Год назад
@@eduardocardoso6286 of course. but ask what you actually want to know.
@Codemycom
@Codemycom Год назад
@@eduardocardoso6286 I don't have any videos on importing excel files, but a simple google search will find you hundreds of tutorials.
@fsapelqvist
@fsapelqvist 2 года назад
Thanks :)
@Codemycom
@Codemycom 2 года назад
Welcome
@seforaabigail6704
@seforaabigail6704 2 года назад
thanks!!!
@Codemycom
@Codemycom 2 года назад
Welcome!
@grant4458
@grant4458 6 месяцев назад
excellent
@Codemycom
@Codemycom 6 месяцев назад
Thanks
@muhammadsafdar8155
@muhammadsafdar8155 9 месяцев назад
good job
@Codemycom
@Codemycom 9 месяцев назад
thanks
@Zielu13
@Zielu13 2 года назад
Hi man. Can I somehow access data from Venue table and display it in Event table, but from models.py level. So just for example, in Event class I could have: def __str__(self): return self.event.venue.web? I'm stuck, I would appriciate your help very much.
@aamiriqbal6028
@aamiriqbal6028 2 года назад
Hi John I did exactly same for creating Event page as you did in this video but my browser is still showing my the previous calendar page.
@Codemycom
@Codemycom 2 года назад
Wait a couple days and check your code with fresh eyes...you'll likely see the error then.
@asddsa4862
@asddsa4862 2 года назад
Hey John...My code isn't working. The page always shows the calendar. I used PyCharm and Django 4.0 but it didn't work, so later I installed Sublime Text and Git Bash. This time I used Django 3.1.5 using "pip install django==3.1.5" in Git Bash. But the other stuff installed with Django, like asgiref, pytz, sqlparse, were different versions than when you first installed them. But still, after doing all the code over again, it only shows the calendar. I checked it a several times but there is nothing different in yours and mine(Not even the names of the files, variable etc).
@Codemycom
@Codemycom 2 года назад
There are differences...if it was the same it would work the same. You'll have to discover them. I suggest putting it away for a few days and looking at it fresh. The versions are irrelevant.
@aureliuszzdziebeko4544
@aureliuszzdziebeko4544 Год назад
i have the problem that i connected myself to SQL Server 2019. i made the models based on those created in SQL with inspectdb command in python. but when i want to render objects.all() it just doesnt show anything. just a blank line. please help!
@karthikk7460
@karthikk7460 3 года назад
hello, sir I am using MySQL workbench as a database and actually, I have not created any model, I uploaded the image using SQL query in the blob format. can I use that to display the image Django template?
@Codemycom
@Codemycom 3 года назад
MYSQL workbench isn't a database, it's just an interface for the MySQL database. If you want to use databases with django, you need a model. If you don't have a model, no, you didn't upload an image and no you can't use it.
@nagendranfriends3153
@nagendranfriends3153 3 года назад
For blogging real world website with custom domain names is it enough for only SQL LITE for Database or degradation is needed ?
@Codemycom
@Codemycom 3 года назад
No, you wouldn't use sqlite3 for production level websites.
@nezhatnour2462
@nezhatnour2462 2 года назад
Thank you for the video. Very Good! Why does not my attendees show on the page? Instead of the attendees, it says Admin!?
@Codemycom
@Codemycom 2 года назад
You made a mistake somewhere
@wnywebdevelopment8757
@wnywebdevelopment8757 2 года назад
You used users when it should be user in your for loop.
@redoansaleh
@redoansaleh 3 года назад
please give me heart
@Codemycom
@Codemycom 3 года назад
huh?
@shobithbaskaran5291
@shobithbaskaran5291 2 года назад
Hi John, I am getting this error always while try to add the user in admin panel. I have tried all sorts of options or solution provide. But still not able to add the data..Error is :"No such table: main.auth_user__old"
@Codemycom
@Codemycom 2 года назад
you may have misspelled something
@anouarnahi6925
@anouarnahi6925 3 года назад
Hey john I'm looking to add a job offre form in my django project were the user chose to add skills on clicks, I've tried alot to find a way with no success if you can help me out
@Codemycom
@Codemycom 3 года назад
Doesn't this video show you exactly how to do it?
@anouarnahi6925
@anouarnahi6925 3 года назад
@@Codemycom no it dosen't at all, what I want to add is a form were the user create a job offer with a description and chose to add as many skills as he wants to on clicks is it possible to do so?? I've been told that I can do that with ajax but I did not find how
@dailydoseofreddit8813
@dailydoseofreddit8813 2 года назад
brother of peter mackinon
@GamesandTechs
@GamesandTechs 2 года назад
Doing this it displays all data from database but i just want database of a user to be private and show their data only to them if multiple users are in database!!!! Please help on this
@Codemycom
@Codemycom 2 года назад
I have lots of django courses at codemy.com that can help you
@rokibulhaque1673
@rokibulhaque1673 8 месяцев назад
Hi, is it possible to share a tutorial for nested forms using Django & HTMX, please...
@elitecoder9246
@elitecoder9246 3 года назад
first like
@Codemycom
@Codemycom 3 года назад
nice!
@elitecoder9246
@elitecoder9246 3 года назад
@@Codemycom send me heart please
@sachinsinghal13
@sachinsinghal13 3 года назад
I seiously don't know why his videos has only a few likes and few views, he's one of my most favorite youtubers for programming and is so helpful, he deserves more than that. Like if you agree.
@elitecoder9246
@elitecoder9246 3 года назад
@@sachinsinghal13 yeah
@Codemycom
@Codemycom 3 года назад
@@sachinsinghal13 thanks! Tell your friends!
@abdullahalsaeed8686
@abdullahalsaeed8686 2 года назад
so we should know about sql before learning django?
@Codemycom
@Codemycom 2 года назад
No, why would you think that? The point of a web framework like django is that you never need to know sql ever.
@asgeralia8802
@asgeralia8802 4 месяца назад
Sir i want dynamic vertical menu from database can u pls explain
@elitecoder9246
@elitecoder9246 3 года назад
omg first comment too (without you)
@Codemycom
@Codemycom 3 года назад
Awesome!
@The-Next-Horizon
@The-Next-Horizon Год назад
Everything's ok but alignment of card/text is on right side of screen. Kindly tell me the solution.
@Codemycom
@Codemycom Год назад
Simply look at your code, and then look at my code and discover the difference.
@MrBunnylok
@MrBunnylok 4 месяца назад
But how to show database view data in django orm
@srinikethatulasi9923
@srinikethatulasi9923 11 дней назад
12:53 important
@Codemycom
@Codemycom 10 дней назад
You really don't need to post timestamps over and over again
@360ibra2
@360ibra2 Год назад
Will this work for firebase
@Codemycom
@Codemycom Год назад
if you modify it for firebase it will.
@prasangaprix2133
@prasangaprix2133 Год назад
can i use xammp dms for this?
@Codemycom
@Codemycom Год назад
why would you want to? You don't have to use anything but Django.
@prasangaprix2133
@prasangaprix2133 Год назад
No, I am asking that question only to improve my knowledge
@nagendranfriends3153
@nagendranfriends3153 3 года назад
How to host a DJANGO website with custom domain names . Not in horoko are somethings else . Like a real world
@Codemycom
@Codemycom 3 года назад
Heroku is real world. You need a hosting company or you can't do it.
@nagendranfriends3153
@nagendranfriends3153 3 года назад
How to host our DJANGO website on AWS , Digital Ocean , Godaddy like that . Please teach on that
@Codemycom
@Codemycom 3 года назад
@@nagendranfriends3153 Sorry, I usually teach how to host them on heroku
@nagendranfriends3153
@nagendranfriends3153 3 года назад
@@Codemycom yes sir that why I requesting you to teach as real world productions sir please
@Codemycom
@Codemycom 3 года назад
@@nagendranfriends3153 Heroku IS real world production.
@elitecoder9246
@elitecoder9246 3 года назад
is codemy.com free for me?
@sachinsinghal13
@sachinsinghal13 3 года назад
yh I think so though idk
@RonVoldman
@RonVoldman Год назад
I already know how to do this, what is the point of this video?
@Codemycom
@Codemycom Год назад
Do you think I made this video just for you, after reading your mind and knowing what you do and don't already know? LMAO
@OpGamerz-qz4yz
@OpGamerz-qz4yz 3 года назад
This was exactly what I was looking for! Thanks again.
@Codemycom
@Codemycom 3 года назад
Glad I could help!
Далее
КВН 2024 Высшая лига Четвертая 1/4
1:52:57
Never waste PASTA SAUCE @itsQCP
00:19
Просмотров 7 млн
Pull Data From The Database - Django Databases #3
12:26
Pagination For Django - Django Wednesdays #18
18:53
Просмотров 40 тыс.
Create A Search Bar - Django Wednesdays #9
17:04
Просмотров 94 тыс.
Why You NEED To Learn FastAPI | Hands On Project
21:15
Просмотров 150 тыс.
If __name__ == "__main__" for Python Developers
8:47
Просмотров 383 тыс.