Database Models & Admin Panel | Django Framework (3.0) Crash Course Tutorials (pt 5)

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ส.ค. 2024

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

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

    Don't forget to check out my Complete Django course! dub.sh/NvGboTI

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

    Thank you so much for doing that . Explaining every line you write is something not so many on TH-cam or even university does it

  • @vatreni8529
    @vatreni8529 4 ปีที่แล้ว +10

    Hey Dennis. I just wanna thank you for making this course series. Loved them and was really helpful! Thanks!

  • @rayganmudberry375
    @rayganmudberry375 4 ปีที่แล้ว +15

    Awesome. i'm glad that you start this series on latest version of django. thank you so much. please make awesome awesome project and ideas on django. god bless you

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว +2

      Raygan Mudberry thank you for your comment :) glad you found this helpful!

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

    Thank you very much, got here after giving up several "Tutorials" without explanations why they are writing those lines..

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

    You know what I was jumping from one utube tutorial to other but now I'm stuck cuz this man is great......💓💓

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

    I really don't know what can I add to my previous comments, but I'll add this comment to help youtube algorithm to recommend this course who really need this knowledges! This really cool job! My regards! Thanks a lot!

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

    Denis! I just want to say thank you a lot cause these videos help me a lot.

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

    These series are so good. Great explanations!

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

    From a database design and management point of view, it is best practice to create tables or in this case classes of linked "choice" data rather than hardcore it as you have show here. Even for simple choice lists....I do realize this is a simplified example, before the next lesson. :)
    Having choice lists as separate data tables, allows edits and additions (maintainence) by a power user through the admin portal, rather than having to make additions in the code. - I am really enjoying your videos Dennis...Keep up the great work!

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

    Awesome. i'm glad that you start this series on latest version of django. thank you so much

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

    This was a stepping stone for me

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

    Thank god you are doing a tutorial on the latest version of django well on 3.0 but still every other tutorial is 2.x or older. I really like your videos so far and the have helped me a lot. You explain everything really good and your videos are easy to follow. You deffinitely deserve more subscribers. I have a question though, I didn't really understand why there were two of each choice in the STATUS variable and in the CHOICE variable. Not really important but would be nice if you could explain this. Thanks and keep up the good work :)

    • @vyacheslavkotov9283
      @vyacheslavkotov9283 4 ปีที่แล้ว

      This section (just below) describes what it all means:
      developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Models#BookInstance_model
      Almost the same is written in the documentation)
      docs.djangoproject.com/en/3.0/ref/models/fields/#choices

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

    Thanks Denis sir, I loved all your videos a lot and early student of your course, just bought after few minutes after launch...
    now starred your git repo as 300th one to like it...
    thanks for putting precious time for us...

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

    Watching these from Korea and this tutorials are way better than the tutorials,which need to be paid, in this country. I cannot even believe this lectures are free. And your new django course is way cheap man. we have to pay more than 50 bucks for a django tutorials in this country and it sucks. I really love your channel and vidoes.

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

    This video was exactly what I was looking for.

  • @SunriseBusinessClub
    @SunriseBusinessClub 4 ปีที่แล้ว +12

    Hi Dennis! Question: often see PostgreSQL requirements for django dev, like a MUST (very popular SQL). Can u please make a crush course on it later???

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

    This is helping me so much. Thank you for all these videos. So far, the best free Django course I've found. :)

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

    Dennis you are one of the my greate teacher.

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

    Your videos are more interesting an better than my school teachers😃♥

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

    Thanks for the amazing course!

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

    Excellent explanation, just subscribed!! 🎉

  • @hobbit2770
    @hobbit2770 4 ปีที่แล้ว +5

    I just want to say that your videos have been very helpful. I love the explanations as you go about coding. Thank you very much.
    In the end, are you going to show how to migrate to a database (e.g. MongoDB)?

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

      Thank you! I’ll integrating a Postgres dB for this series. I’m actually studying mongo + Django integration on the side so maybe I’ll make a one off video about it. Love mongo dB :)

    • @SportTechNomad
      @SportTechNomad 4 ปีที่แล้ว

      @@DennisIvy isn't django for relational databases ?

    • @SportTechNomad
      @SportTechNomad 4 ปีที่แล้ว

      @@DennisIvy i wanted mysql db connection :'(

  • @petecodes
    @petecodes 4 ปีที่แล้ว +2

    Great lesson!

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

      Thank you pete :)

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

    Thank IVY, this really helped a lot.

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

    great teaching skills m8 props to you

  • @laminebouzidi1902
    @laminebouzidi1902 4 ปีที่แล้ว

    Shoutout from Algeria brother, keep up the good work

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

    Привет Dennis. Thank you for this tutorial))
    afaik * considered to be an antipattern

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

    Bro I want to thank you so much for doing what you do, I m broke as fuck but I m starting considering to give you some contribution for you work !

  • @banaras.wala.foreignaala
    @banaras.wala.foreignaala 4 ปีที่แล้ว

    Wonderful, So far So Good

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

    Do these classes represent the objects in the tables or the tables themselves? I notice the fields are static indicating that the Customer class represents the customer table, but wouldn't we need an object whose instances each represent an individual customer (with a non-static name field)?

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

    def __str__(self):
    showing invalid

  • @gersoninthekitchen6656
    @gersoninthekitchen6656 4 ปีที่แล้ว

    Thanks mate, you are the best.

  • @Dani-si8ie
    @Dani-si8ie 3 ปีที่แล้ว

    for those with Python 3 and Python 2 on their mac - mac defaults to python 2, so run: python3 manage.py migrate

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

    no changes detected?? after python manage.py makemigrations

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

    hm...Dennis, after when I added classes into models.py, when I print command >> python manage.py makemigrations >> in console typed "No changes detected", what could be the reason?

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว +2

      Its either because your changes have already been made and you just need to run migrate or something when wrong when you configured your app and it cant find the models.py file. Make sure you have added the app to INSTALLED_APPS in settings.py

    • @pavelolifer9934
      @pavelolifer9934 4 ปีที่แล้ว

      @@DennisIvy yes, i don't added my_app into settings, thanx

    • @digitally_nomadic
      @digitally_nomadic 4 ปีที่แล้ว

      @@pavelolifer9934 Had the same problem. Turns out I didn't do manage.py startapp crm in the beginning

    • @funkmasterpete2871
      @funkmasterpete2871 4 ปีที่แล้ว +2

      I had the same problem. python manage.py makemigrations accounts

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

      Have the same problem but no idea how to add app to Installed_Apps

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

    Hi Dennis , Thank you very much for all your efforts , time and making things easy for us . Quick question is it possible to use existing Oracle DB wit Django with no ORM , but use model forms ?

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

    11:00 - how come no "python manage.py makemigrations" & "python manage.py migrate" is required by the change at 11:00 after implementing __str__?

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

    I have done things exactly the same but for some reason when i click the "add customer" button no fields such as name, phone, date show up in the admin interface. I looked up in stackoverflow and rechecked all the possible errors that may have occurred but all the things seem to be fine. I cannot find the problem so it will be a great help if you can tell me what am i doing wrong here. Thanks in advance.

  • @bishaladhikari8691
    @bishaladhikari8691 4 ปีที่แล้ว

    You are my god.Thank you for your video

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

    i am watching now.

  • @vibhubhola34
    @vibhubhola34 4 ปีที่แล้ว

    What is the best way to organise models across apps. What are the best practices when you have multiple apps within your project ? E.g. If I want to have a dedicated app for Accounts (which will have models for user profile etc.), and I want to have another app for ManageCustomers and ManageProduct, which model should go where ?
    BTW, loving the series and learning so much from it ! Thanks a ton for sharing your knowledge

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

    thanks great job sir

  • @Magistrado1914
    @Magistrado1914 4 ปีที่แล้ว

    Excellent course
    06/07/2020

  • @georgepartassides525
    @georgepartassides525 4 ปีที่แล้ว +2

    What if I want to rename the class like from Order to another name? I try to do it manually in models.py and then admin.py and migrate but I receive an error. Any ideas please?

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

      do python manage.py makemigrations and then python manage.py migrate

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

    great thank you

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

    Ouch! Be careful dude. The form fill function of your browser leaks your personal information like a firehose!
    But great video series all around.

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

      What would be a good way to avoid this?

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

      @@naschwindias3873 I would suggest a dedicated browser just for videos. Without password manager addons and disabled autofill function , or only using safe dummy data with that browser.

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

      @@tohafi OHhh.. you meant like that. Cool cool, I thought it was something related to Django, you know, change a few settings.

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

    Question please. How is your customer model related to/different from 'users' ? Aren't all customers some sort of users who have to create an user account anyway?

  • @prabhatchauhan1842
    @prabhatchauhan1842 4 ปีที่แล้ว

    Can you help in how to get the radio button fields value in django model and fetch them on database

  • @KevinTempelx
    @KevinTempelx 4 ปีที่แล้ว

    I thought tuples just have keys? Not a key value pair? So in this case I'm confused how it works with the class.

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

    sir makemigrations not working pls helpme

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

    I have issue can you help me i face this issue
    class Customer(modeLs.ModeL):
    NameError: name 'modeLs' is not defined

    • @rangabharath4253
      @rangabharath4253 4 ปีที่แล้ว

      It should be small l. class Customer(models.Model):

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

    I can't create superuser it said skipped due to not running in a TTY. please help me I tried searching answer and tried the ones in stack overflow but nothing happens

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

    can I set up more than one database?

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

    Shouldn't the price always be integer? Stripe and other payment processors always expect price in cents.

  • @agroforestryconsultancyroz210
    @agroforestryconsultancyroz210 4 ปีที่แล้ว

    Hi Dennis, For every db_database table I would like to have a field where the "user_id" is automatically updated. The user_id of the current user that is submitting the data in the form template. Isn't there an easy way for in models? Thanks in advance,

  • @panamacitybeach4175
    @panamacitybeach4175 4 ปีที่แล้ว

    Can we have a SQL file as part of the source to load the data into a mysql DB for those of us not using sqllite it is a lot of data to enter manually to follow your examples, ...

  • @saeedou
    @saeedou 4 ปีที่แล้ว

    Hello. In setting.py why did you use MEDIA_URL? And for the CSS did use nothing?
    Could you please explain this part a little bit more?

  • @rokhribar5512
    @rokhribar5512 4 ปีที่แล้ว

    Why do i get the following error?
    django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
    I tried running :
    set DJANGO_SETTINGS_MODULE=mysite.settings
    django-admin runserver
    But whatever i put in mysite it says module not found.

  • @wandererkhalid
    @wandererkhalid 4 ปีที่แล้ว

    Did this
    class Customer(models.Model):
    name = models.CharField(max_length=200, null=True)
    phone = models.CharField(max_length=200, null=True)
    email = models.CharField(max_length=200, null=True)
    date_created = models.DateTimeField(auto_now_add=True, null=True)
    def __str__(self):
    return self.name
    IN CONSOLE IT SAYS : AttributeError: 'str' object has no attribute '_meta'
    HELP

  • @codecrafts5263
    @codecrafts5263 4 ปีที่แล้ว

    No accounts_product table found. What should I do?

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

    Does anyone know why we need to use tuples for the dropdown menu?

  • @ryan_0337
    @ryan_0337 4 ปีที่แล้ว +2

    I just have a question Dennis, Do you know how we change the type of the date into the European standards?
    Is that possible to translate your admin app in other language ?
    Thanks for your help in advance

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

      Honestly I have never done that but I'll do some research because I'm curious myself. I'll let you know if I find anything :)

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

      I think that would be possible if you changed your windows timing to the required standard bcz the date Time module will pick your window timing...

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

    why when i created def __str__(self): gives me error

  • @KrishnaManohar8021
    @KrishnaManohar8021 4 ปีที่แล้ว

    Insted of Tuple we can use list/dict?

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

    class CustomerAdmin(admin.ModelAdmin):
    list_display = ['name','phone','email']
    list_filter = ['date_created']
    search_fields = ['name']
    admin.site.register(Customer, CustomerAdmin)

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

    Hi dennis how do you actually change the ID for the UU one?

  • @mr.chowdhury2737
    @mr.chowdhury2737 3 ปีที่แล้ว

    why tuple value is dulicate?

  • @AmitKumar-ux1mz
    @AmitKumar-ux1mz 4 ปีที่แล้ว

    How do I store multiple products per order? Like when we go for shopping we buy a lot of things and they all get billed to the same order. How to do that?

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

    Curious as to why you don’t use venv... I’ve seen it recommended before with django

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

      I do use it in real world apps and will show it later. I noticed a lot of times beginners get confused with this step so I think it’s important to get the project up and running first before I introduce stuff like that. I think it’s more important for people to just get things set up before learning best practices :)

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

      Static files also have a step like this that I won’t show until we start putting this project on a production server.

  • @jhoanmartinezsilva2609
    @jhoanmartinezsilva2609 4 ปีที่แล้ว

    How the user could create a new category, maybe if it does not exists

  • @danielpereira9524
    @danielpereira9524 4 ปีที่แล้ว

    its showing error when i add user, (operational error). what should i do

  • @fanfarorro
    @fanfarorro 4 ปีที่แล้ว

    Why it appears as orders in django admin not "order"?

  • @mohibul373
    @mohibul373 4 ปีที่แล้ว

    Hi Dennis, i am having a problem. i cannot access admin page. Its shows no error with right credential but stays in the login page. I googled it but couldn't find right solution. my django version is 3.0.5. is it something to do with versions? Plz help

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

    It would be really confusing if you're a php programmer, still trying to figure out, feeling PHP was easy , but ik code is reduced a lot Django

  • @ThePANTHERO
    @ThePANTHERO 4 ปีที่แล้ว

    I'm following, very impressive, kindly if possible show us a short video of how to integrate bootstrap admin theme to the project.

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว +2

      Just about to reply to this message but i see you find my django/bootstrap tutorial :)

    • @ThePANTHERO
      @ThePANTHERO 4 ปีที่แล้ว +2

      Thanks I found it, keep it up the good work.

  • @AbbasAli-ep3kb
    @AbbasAli-ep3kb 4 ปีที่แล้ว +1

    hi Dennis can you share the book of django if you have.....thanks in advance

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

    زوووووووولي

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

    I am stuck in add customer or add product with below error
    OperationalError at /admin/store/customer/add/
    no such table: main.auth_user__old
    Any idea why?

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

      Same here . How did u resolve it ? Please let me know

  • @NetwrokForGeeks
    @NetwrokForGeeks 4 ปีที่แล้ว

    i have a question... when i run "manage.py migrate " command i cant see any result like applying contenttypes .0001 ....,applying auth why ?
    btw i am suing pycharm with django 3.0.3 .thus ,i cant createspueruser? i stopped here untill find the solution.thanks

    • @mihirthakur917
      @mihirthakur917 4 ปีที่แล้ว

      I hope you found out the reason for the behaviour you mentioned

  • @rayganmudberry375
    @rayganmudberry375 4 ปีที่แล้ว

    Question? can we use database like SQL and ORACLE with django??

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว

      Absolutely! I’ve even used mongo db

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

    TypeError at /admin/
    'set' object is not reversible i have this error can u tell me why ?

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

      ooo i found it its beacouse i use this brackets {} in urls.accounts,instead []

  • @kxa5540
    @kxa5540 4 ปีที่แล้ว

    no such tabel = accounts_customer error

  • @louismefor9539
    @louismefor9539 4 ปีที่แล้ว

    Going to the admin url breaks stops the server, i dont know what is going on

    • @DennisIvy
      @DennisIvy  4 ปีที่แล้ว

      They’re can be many reasons for that. You can send your source code to dennisivy11@gmail and I’ll take a look.

    • @louismefor9539
      @louismefor9539 4 ปีที่แล้ว

      @@DennisIvy alright dennis, but please what are some of the reasons though, cause some times it works and after i refresh the broswer it stops

    • @louismefor9539
      @louismefor9539 4 ปีที่แล้ว

      @@DennisIvy I have sent you the source code

    • @mahmudsajib8648
      @mahmudsajib8648 4 ปีที่แล้ว

      @@louismefor9539 downgrade django version to 2.2. I had to do so & it works.

    • @louismefor9539
      @louismefor9539 4 ปีที่แล้ว +2

      @@mahmudsajib8648 I had to rather upgrade to 3.8.1 and then was using 32 bit version of python which I uninstalled and installed the 64 bit version and now everything works really fine

  • @joannamollman8165
    @joannamollman8165 4 ปีที่แล้ว

    Well, my comment disappeared, but I figured it out.

  • @SagarSagar-ro3fj
    @SagarSagar-ro3fj 2 ปีที่แล้ว

    If you get this
    Exception Type: OperationalError Exception Value: no such table:
    then use this:
    python manage.py migrate --run-syncdb

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

      thanks, i was stuck at that part