Using Multiple Database Tables With Django - Django Wednesdays #4

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.ค. 2024
  • In this video we'll start to set up our Database using many Tables.
    Using databases with Django is super easy. In this video we'll set up our database with three different tables; a Venue table, a Users table, and an Events table.
    I'll show you how to connect the tables using Foreign Keys and ManyToMany Fields.
    We'll also set up the Django Admin area, and add our three new database tables to the admin area.
    Timecodes
    0:00​ - Intro
    1:40 - Set Up Django Admin Section
    2:44 - Create Django Admin User
    4:43 - Intro To Django Databases
    5:47 - Create Event Database Table
    11:10 - Adding String Representation Method
    11:56 - Create Venue Database Table
    14:50 - Connect Event Table To Venue Table With Foreign Key
    16:30 - Create MyClubUser Database Table
    18:00 - Associate UMyClubUsers to Events With Many To Many Field
    18:48 - Add Database Tables To Django Admin Area
    21:14 - Start To Make Migrations
    21:42 - On_delete=models.CASCADE
    22:50 - Make Migrations and Migrate Database Tables
    23:45 - Check Admin Area For Tables
    27:44 - Conclusion

ความคิดเห็น • 109

  • @Codemycom
    @Codemycom  3 ปีที่แล้ว +3

    ▶️ Watch Entire Django Wednesdays Playlist ✅ Subscribe To My TH-cam 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

  • @techwithgantavya6381
    @techwithgantavya6381 3 ปีที่แล้ว +13

    Hey John your channel has literally changed my life man thanks a lot

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +4

      Wow, that's awesome! I'm so happy that you found value in it!

  • @a1225johnny
    @a1225johnny 2 ปีที่แล้ว +5

    The whole series of tutorials is great. The clarity of concept and implementation really helped me a lot! Thank you so much!

  • @alcidesmarcano
    @alcidesmarcano 3 ปีที่แล้ว +1

    Thanks John for another great video of Django!

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      My pleasure!

  • @keshutheindianspitz6115
    @keshutheindianspitz6115 2 ปีที่แล้ว

    This is the way how to learn Django thoroughly. Thank you for this wonderful tutorial. I've tried to learn Django from different TH-cam channels but by this set of tutorials I've just loved to learn django, Once again thank you so much. From India, kerala

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว +1

      You're very welcome!

  • @nekoulah522
    @nekoulah522 3 ปีที่แล้ว

    Man, you are a legend, thanks a lot for all the videos

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Thanks for watching!

  • @johngiangrande2996
    @johngiangrande2996 3 ปีที่แล้ว

    Great vid, John. Learned a lot there. Thank you!

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Glad to hear it!

  • @fernandocorenstein6531
    @fernandocorenstein6531 2 ปีที่แล้ว

    This guy is an absolute master.

  • @highlycalm
    @highlycalm 2 ปีที่แล้ว

    This is literally what I needed, thank you so much

  • @rauldinho
    @rauldinho 3 ปีที่แล้ว

    This channel needs more attention. Really useful examples instead of the old todo app. This apps really teaches important things and not only the most basic stuff.

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Thanks! Tell all your friends about it :-p

  • @rafaelsoteldosilva
    @rafaelsoteldosilva ปีที่แล้ว

    This is great stuff, really!!!

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      Glad you think so!

  • @bagbmxt
    @bagbmxt 2 ปีที่แล้ว

    thanks for helping you got +1 subscriber from brazil

  • @sh-andriy
    @sh-andriy ปีที่แล้ว

    Thanks so much! This was very helpful for me)

    • @Codemycom
      @Codemycom  ปีที่แล้ว +1

      Happy to hear it!

  • @hemantd9349
    @hemantd9349 2 ปีที่แล้ว +1

    Loved your energy! and smashed the subscribe button :-)
    Very nice tutorial...

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      Thanks! Appreciate it!

  • @fustigate8933
    @fustigate8933 2 ปีที่แล้ว

    You are really underrated!

  • @varunmalik2583
    @varunmalik2583 ปีที่แล้ว

    Simply wow❤

  • @mahdisamadi1647
    @mahdisamadi1647 2 ปีที่แล้ว

    thanks john you are the 💛💛💛💛best

  • @rachaelamuge
    @rachaelamuge 3 ปีที่แล้ว

    Hi
    waiting for the next video,
    It's really cool am understanding it thanks a lot

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      The next video is already out :-) check the playlist

  • @guisanfe
    @guisanfe 2 ปีที่แล้ว

    Really nice videos, congrats!!

  • @ajaniyeseer5947
    @ajaniyeseer5947 10 หลายเดือนก่อน

    Your videos are so underated..you deserve more than the likes am seeing here

    • @Codemycom
      @Codemycom  10 หลายเดือนก่อน

      Tell your friends ;-)

  • @mellesiamaged9817
    @mellesiamaged9817 6 หลายเดือนก่อน

    thank you. you saved my

    • @Codemycom
      @Codemycom  6 หลายเดือนก่อน

      welcome

  • @labialkosta261
    @labialkosta261 3 ปีที่แล้ว

    You are awesome like always

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Thanks! You're awesome too :-)

  • @seforaabigail6704
    @seforaabigail6704 2 ปีที่แล้ว

    Thanks!

  • @manuelradovanovicprogrammer
    @manuelradovanovicprogrammer 3 ปีที่แล้ว

    Thank you !

  • @ernestassiusis1333
    @ernestassiusis1333 ปีที่แล้ว

    Thank you

  • @yasayah7289
    @yasayah7289 2 ปีที่แล้ว

    Great stuff thank you! Speaking of tables, be nice if venue/event coordinators could request/reserve literal tables and chairs for a venue. Quantity on hand, reserve ahead of time. Two member types, attendees and coordinators. Attendees can buy t-shirts =D

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      Just a matter of adding those fields to the model...

  • @asce313
    @asce313 3 ปีที่แล้ว

    Hey John! Could you please add a search functionality in the Django blog tutorial? Thanks alot for this tutorial.. I really appreciate your hardwork and keep up the great work!

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      Yeah we'll likely do that.

  • @Kennerdoll
    @Kennerdoll ปีที่แล้ว

    John Kindly make some tutorials just on Model's relationships

  • @delllatitude299
    @delllatitude299 3 ปีที่แล้ว

    how to query or handle large tables or databases. for example a table has 1M+ records or a database has 10M+ records. how we can handle multiple database in one project. please make a video on it with small number of records to understand it's best practice. Thanks Eagerly need that

  • @saikiran9185
    @saikiran9185 2 ปีที่แล้ว

    May I know the reason why giving inside parameters for charFiled(zip_code) ,what happens if we not mention that?

  • @wiki-infodevelopment3369
    @wiki-infodevelopment3369 2 ปีที่แล้ว

    Hope you make a tutorial about Using Multiple Database in on project using routers

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      No plans for that.

  • @GogCode
    @GogCode 2 ปีที่แล้ว

    please explain multiple apps models interaction

  • @mufazmi
    @mufazmi ปีที่แล้ว

    After watching your this video. I am looking for : " How to use django models with foreign keys across multiple databases"

  • @subijoyacharya3189
    @subijoyacharya3189 3 ปีที่แล้ว

    Hi John, I am trying to connect my firebase database with Django Web page.
    Please, please make a video on connecting Django website with Firebase database.

  • @vipergmainggaming2653
    @vipergmainggaming2653 3 ปีที่แล้ว

    first view and second like

  • @anandhukrishna1112
    @anandhukrishna1112 3 ปีที่แล้ว

    Sir please add role based login

  • @mohamedelmabrouki512
    @mohamedelmabrouki512 3 ปีที่แล้ว

    Sir, is there a way please to move data from an html page to an other one based on some conditions.

  • @Charoiz
    @Charoiz ปีที่แล้ว +1

    Hello from Finland. I have a problem. Everything works fine, until I try to add my events and venues. I am able to add users, but django gives me an error after I click "add" after the other two. What did I miss?

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      Not sure. It depends what the error says.

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      @@Charoiz awesome! Good job!

  • @rachaelamuge
    @rachaelamuge 3 ปีที่แล้ว

    Hey, how do i create a database table with the following supplier,loader,customer and order

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      In the same way I do it in the videos

  • @nezhatnour2462
    @nezhatnour2462 2 ปีที่แล้ว

    Could you please teach us how to create an event calendar widget

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      didnt we already do that?

  • @d.thangadurai1403
    @d.thangadurai1403 2 ปีที่แล้ว

    Hi Sir,Please upload , select country,state and city wise in django

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      This playlist is finished. You have all the knowledge here to do that already with these videos.

  • @labialkosta261
    @labialkosta261 3 ปีที่แล้ว

    Can I use Django and node.js in the same website for exemple using firebase and mysql in the same time?

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Not likely. Node and Django are two separate backed web frameworks.

    • @labialkosta261
      @labialkosta261 3 ปีที่แล้ว

      @@Codemycom thx

  • @usmankhawar888
    @usmankhawar888 2 ปีที่แล้ว

    Hi,
    Sorry I am new to this. That admin panel and all the data we store in tables, where that data file is stored?
    Let say I have a website hosted on a Web Server does that table data stored in phpmyadmin panel or it creates a new database file in the root directory of where the website is living.
    If its the phpmyadmin stuff where to configure the database ip, port, user name and password?
    Thanks

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว +1

      Django takes care of all the database stuff. It depends on the hosting service you use as to where the database sits. phpmyadmin is not a database, it's just an interface to connect you to a database visually. You generally wouldn't use that for django. Your database config settings will be in your settings.py file in your django project.

    • @usmankhawar888
      @usmankhawar888 2 ปีที่แล้ว

      @@Codemycom Thanks for replying and also thanks for creating such videos. I had learned a lot from your channel and your tkinter series is the best tkinter guide on youtube. THE BEST...
      Thanks man

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว +1

      @@usmankhawar888 welcome

  • @halaezzeddine3894
    @halaezzeddine3894 2 ปีที่แล้ว

    I did the same thing but when typing python manage.py makemigrations, it is giving "no changes detected", why?

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      You probably forgot to save your code in the text editor.

  • @mircagardenman7629
    @mircagardenman7629 2 ปีที่แล้ว

    Hi Master: I am having a hard time building the following: One Artist - Many albums listed. I want to be able to do action a list of musicians. e.g. Linkin Park --> List all of the L.P. albums --> then select each albums and show details of the albums.

    • @mircagardenman7629
      @mircagardenman7629 2 ปีที่แล้ว

      At the moment, i'm able to build a Musician list and link each musician to One album, but i having a hard time show details of that album (Genre, track list, length of the album etc.) I think i missing something,

  • @razinshahril1162
    @razinshahril1162 2 ปีที่แล้ว

    Why are you not liking this video? Like it now

  • @PREMYADAV-sv6sg
    @PREMYADAV-sv6sg 8 หลายเดือนก่อน

    I have a problem
    Let's say I have two models in my app i. E. Profile and Training.
    I want to display name, age and address from profile and number of training, name of last training he has from training table. How can i do that? Please help me

    • @Codemycom
      @Codemycom  8 หลายเดือนก่อน

      Just call them in the way you call anything from a table...make two model calls on the backend, in the normal way..pass them both to the frontend thru the context dictionary in views.py in the normal way.

  • @aiantorno9842
    @aiantorno9842 2 ปีที่แล้ว

    HI John,
    When I added a user and see the list of Users it show 'MyClubUser object (1)' and not the user's name. How do I see the user's name?
    ps, these have been excellent videos!

    • @aiantorno9842
      @aiantorno9842 2 ปีที่แล้ว

      Issue resolved, needed to indent the def statement ; )

  • @amineslami2946
    @amineslami2946 2 ปีที่แล้ว

    venue = models.ForeignKey(Venue, blank=True, null=True)
    ^
    IndentationError: unindent does not match any outer indentation level
    I get this error what should I do?

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      The error tells you. Your code is not indented correctly. Python is indentation specific. It has to look like the code in the video.

  • @PritpalSingh-kz6kt
    @PritpalSingh-kz6kt 2 ปีที่แล้ว

    Is it microservices concept in django?

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      huh?

    • @PritpalSingh-kz6kt
      @PritpalSingh-kz6kt 2 ปีที่แล้ว

      @@Codemycom Can you make video on microservices using django.

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      @@PritpalSingh-kz6kt No, I don't do buzzword stuff like that.

  • @phantomx1647
    @phantomx1647 2 ปีที่แล้ว

    How do I merge data into one cell in a table like instead of
    Row 1 | A | B | C
    Row 2 | Z | X | Y
    Do this
    Row 1 | A
    B
    C
    Z
    X
    Y

  • @krishnadhingra2723
    @krishnadhingra2723 3 ปีที่แล้ว +1

    Hi Sir, please read the full comment.
    I'm 14 years old and I think that I'm pretty good at python, html and css. I'm able to make some good webpages. I'm thinking of freelancing. Do you think that It's a good idea freelancing at this age.
    Pleases tell if you have any suggestions for me.
    Would love to hear from you!

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Give it a try and see how it goes! Good luck!

    • @krishnadhingra2723
      @krishnadhingra2723 3 ปีที่แล้ว +1

      Thank you

  • @anwarsanusi475
    @anwarsanusi475 3 ปีที่แล้ว

    Yosh

  • @cryptotechhelp1459
    @cryptotechhelp1459 ปีที่แล้ว

    Dude, everyone can see your videos free. You should tell us to enrol at your school to get extras you plug in your TH-cam vids. I am throwing money away monthly on a paid course not nearly as comprehensive, on the promise of a job placement after. Do that!

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      I do literally do that in every video lol including this one. At the beginning and end of every video.

  • @seforaabigail6704
    @seforaabigail6704 2 ปีที่แล้ว

    thank u