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

preview_player
Показать описание
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
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Django Wednesdays Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:

Codemycom
Автор

This is so cool and super easy, if you know what to do. I'm learning so much from your videos!

dohnot
Автор

This was exactly what I was looking for! Thanks again.

DerekStevens
Автор

When you show how to use - awesome! Django is going to easy! Thank you very much!

timurdjumaniyazov
Автор

I m just a bigginer with python but you just made django more than fun to me. Man u r amazing

yeabayu
Автор

thanks for the great video hope you will dig deeper in manytomany and make a video about tabular inline in the admin

fadyghalayiny
Автор

Hey thank you for uploading these, I really enjoy your python videos.

spencebuzz
Автор

thanks a lot, this video was really well made, I was able to understand everything even though I am a beginner

DevanshChopra-ymzt
Автор

Thanks, Another Great Video as Always

sachinsinghal
Автор

It's just matter of time when this channel will explode and became super famous

dekito
Автор

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!!!

yasayah
Автор

really nice and informative, maybe next time you can make python window little wider so we can see entire code at once ?

mantvydastautkus
Автор

hey, thanks for the videos, it helped me a lot!

do you have an exemple where you use existing tables ?

eduardocardoso
Автор

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.

Zielu
Автор

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!

aureliuszzdziebeko
Автор

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.

aamiriqbal
Автор

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?

karthikk
Автор

For blogging real world website with custom domain names is it enough for only SQL LITE for Database or degradation is needed ?

nagendranfriends
Автор

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).

asddsa
Автор

Sir i want dynamic vertical menu from database can u pls explain

asgeralia