Django Tutorial - SQLite3 DataBase Tutorial

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 156

  • @meowareasaservice
    @meowareasaservice 11 месяцев назад +7

    str(item.text) because your text in the models is char type and not string, so it has to be converted to string to be able to load properly on the browser.
    I know it's too late now, but I hope this helps people who learn by watching this video.
    I really love all your videos, you are very good at explaining.
    I came from old fashioned PHP frameworks and want to learn django. I'm glad I make a good decision, python is great and versatile. Back end front end, it can do anything.

  • @quidpanic7095
    @quidpanic7095 5 лет назад +11

    You sir are a codin jedi master, thanks for showing this most clear tutorials i've seen in ages. Most programming tutorials are in hindi

  • @dexterasis1004
    @dexterasis1004 3 года назад +5

    I will watch every ad Tim just to give something in return. Thank you for all of your tutorials!

  • @johnshome8443
    @johnshome8443 5 лет назад +16

    As someone below mentioned, I also got an error when trying to run 'python manage.py makemigrations main' I simply had to change max_Length to max_length (lower case 'l') this worked. Thank you for the comment below.

    • @TeaSmuggler
      @TeaSmuggler 4 года назад +2

      For anyone else noticing this: The lower-case "L" in sublime text looks like upper-case when in keyword format. Tim did type "length" in lower case, but it just looks like upper case. The font was probably made in order for the user to be able to distinguish variable names from normal text, not for tutorial purposes.

    • @simchalederman8728
      @simchalederman8728 4 года назад +1

      Thank you JoJo!! i had that same issue and you saved me!

    • @data.practitioner
      @data.practitioner 2 года назад

      Thanks 🙏

    • @amanm5087
      @amanm5087 Год назад

      Thanks man
      saved me from frustration

  • @dav1d_andrew
    @dav1d_andrew 4 года назад +5

    Hi Time. I would like to thank you for this awesome tutorial. I "know" how to "make things work" in Django, but your tutorial is explaining the WHY. Thanks bro.

  • @jimrakel418
    @jimrakel418 5 лет назад +3

    Redid the last 2 video and got almost everything working for me. Hopefully it will come together with the next video.

  • @hello_world_zz
    @hello_world_zz 4 месяца назад

    Just best video instruction. Thanks a lot. And... you changed after 5 years 😊

  • @SafikMaster
    @SafikMaster 5 лет назад +70

    I have watched the whole thing, I made everything work, but I still have absolutely no idea what I just did and what all those things mean.

    • @zlls
      @zlls 4 года назад +4

      yeah it's complicated, to understand, you should know that the 'items' he got are saved in the sql database. So basically when you type a name in the url bar, that name will be passed to the index func and it will response by 'printing' the item text. Sorry if i am not much clear, I'm not an expert and I dont' know if I'm getting wrong with something.

    • @v_vijay_krishnan
      @v_vijay_krishnan 4 года назад +1

      Yeah, this video doesn't explain everything. This video is only for suckers

    • @hooverzavala8071
      @hooverzavala8071 4 года назад +8

      make five to ten diferent basic projects and then you get it, just dont quit

    • @hooverzavala8071
      @hooverzavala8071 4 года назад

      ​@@zlls Yeah but the name is not directly passed to the index; when you type a parameter (127.0.0.1:8000/) in the url bar and press enter, first django search that parameter inside /main/urls.py (), if is founded search the function asociated ( views.index ), which is stored inside main/views.py ( def index(): ) and last run that function

    • @Flamiooo
      @Flamiooo 4 года назад +3

      @@v_vijay_krishnan it is a great video, you are not great student

  • @robertplourde6380
    @robertplourde6380 2 года назад

    This is by far the best tutorial I have found yet!

  • @joel4987
    @joel4987 4 года назад +3

    I thought I was ready for this o.O Back to basics...

  • @manimaran5202
    @manimaran5202 3 года назад

    Edited : Worked thanks ur a life saver

  • @MrABblackriver
    @MrABblackriver 4 года назад

    you are really the best to explain things

  • @anonymousghost5384
    @anonymousghost5384 3 года назад

    I tried that with mysql no problem at all❤❤❤❤❤❤

  • @JeromeNoypi
    @JeromeNoypi 14 дней назад

    Thanks a lot this is Great!

  • @abdurrazzak1612
    @abdurrazzak1612 Год назад

    U re always awesome man

  • @saharamanson1970
    @saharamanson1970 4 года назад +2

    Nice bro keep it up........

  • @paia6447
    @paia6447 Год назад +1

    1:16 the configuration path is important when dealing with templates and custom html

  • @pilleow
    @pilleow 3 года назад +1

    12:02 the way he said "memory address" just killed me XD

  • @lorenamendes7427
    @lorenamendes7427 4 года назад +4

    Thank you for these amazing videos! You explain things very well :)

  • @jorgeastiazaran
    @jorgeastiazaran 3 года назад

    Best tutorial for begginers!

  • @fosterxu
    @fosterxu Год назад

    讲的非常好,点赞!👍

  • @vandanavasudevan143
    @vandanavasudevan143 5 месяцев назад

    Thank you!

  • @Voronza
    @Voronza 3 года назад +3

    Большое спасибо, очень помогло!

  • @Sure_Math_Center
    @Sure_Math_Center Год назад

    Great video

  • @FeedFall8
    @FeedFall8 5 лет назад +2

    I love this video series

  • @mpedzi031
    @mpedzi031 4 года назад

    Great stuff Tim, thanks.

  • @redtomato258
    @redtomato258 Год назад

    Thank you so much

  • @zlls
    @zlls 4 года назад

    Hey, in html you don't need to put , with one it already works ()

    • @flopism493
      @flopism493 12 дней назад

      nice bruh.............after 4 years

  • @tonystarksu8619
    @tonystarksu8619 4 года назад +2

    Tim said that he is going to use SQLite3, but I have no idea where he used it. I don't even see him typing anything about the word 'SQLite'. Can anyone explain it for me?

  • @bricegnanago409
    @bricegnanago409 4 года назад

    Thank you so much ! Can you show me how to create a database view in sqlite and use it in django ?

  • @uromisaac7858
    @uromisaac7858 4 года назад +5

    please my ToDoList is indicating an error, "ToDoList has no objects".
    ls = ToDoList.objects.get(id=id)

    • @320adikos
      @320adikos 3 года назад

      Solution for using Visual Studio Code:
      1. Ctrl + "," (comma)
      2. Extensions --> Python --> Linting --> Enable Linting (chosen)
      3. Linting Pylint Path: python_django
      4. Save & Enjoy
      Before this you must install package: python3 install pylint-django (or python install pylint-django)

  • @hiraawan3430
    @hiraawan3430 3 года назад

    wow like i'm really getting things

  • @danydilo
    @danydilo 3 года назад

    I think you should give more context to your explanations. Would be good if you could briefly zoom out onto the Django architecture and file system and then zoom in into details.

  • @prathampandey9898
    @prathampandey9898 3 года назад +1

    I am getting error "table main_todolist has no column named name" @ t. save( ) 10.36

  • @akshathraghav4978
    @akshathraghav4978 3 года назад +2

    Hey, i am facing an issue. In my item_set.get(id = 1/2/3), an error always pops up telling me that there is no matching item. But when I search for it using the name = '', it works as it should. If anyone else is facing this issue and knows why this is happening, please let me know. Thanks

  • @jhumaroy2418
    @jhumaroy2418 5 лет назад

    Please make a video for quiztest in django with SQLite

  • @shyren_more
    @shyren_more 4 года назад +2

    @Tech with Tim at 13:31, I tried listening to it multiple times the reason that you said why t.item_set.all() doesn't throw error but it just doesn't make any sense, could you please explain in simpler words here in comments
    PS: Great video!

    • @lavanya_m01
      @lavanya_m01 3 года назад

      Btw he wasn't talking about why it didn't throw any error. He was just explaining that each ToDoList has a set of Items.

    • @waqaspathan3337
      @waqaspathan3337 3 года назад

      The item_set function returns a list of all the items belonging to a particular “parent” object. In this case the parent object is the todo list and one of its items happens to be an object called Item. I think the wording in this specific scenario is a bit tricky since both the function name and the object name both share the name “item”, but they are not related.

    • @error0803
      @error0803 2 года назад +1

      Guys, item_set is NOT a keyword. Just part of it is.
      Tim has two models named ToDoList and Item. That Item model's name gets lowercased and added to _set. So it will become item_set. If the model's name were Car, then the set would be named car_set. Set is created when you indicate that the model is in relationship with another model.

  • @marospapan8565
    @marospapan8565 5 лет назад +5

    When I type to command line "python manage.py makemigrations main" I get this error: __init__() got an unexpected keyword argument 'max_lenght'. I checked everything maybe three four times but I still don't know how to fix it.

    • @manish93channel
      @manish93channel 5 лет назад +1

      it should be max_length() I think

    • @Pandaman456
      @Pandaman456 5 лет назад +1

      the L in the max length should be lowercased

    • @edwardnovais7
      @edwardnovais7 5 лет назад

      I'm with the same error, I didn't find nothing wrong. Could someone help me?

    • @edwardnovais7
      @edwardnovais7 5 лет назад +2

      Hi friend, I solved it, you wrote the word 'length wrong. Check it out.

  • @mmanuel6874
    @mmanuel6874 5 лет назад +7

    my item_set.all() doesnt work

  • @vishaljadeja2089
    @vishaljadeja2089 2 года назад +1

    When i do
    " ToDoList.object.all()"
    The output is
    Instead of object name, did i do something wrong ?
    Thank you in advance

    • @kundamwenje2224
      @kundamwenje2224 2 года назад

      am also having the same challenge did you figure it out?

    • @vishaljadeja2089
      @vishaljadeja2089 2 года назад

      @@kundamwenje2224 no brother i try id and other stuff but it won't work.

    • @ednaakisa1777
      @ednaakisa1777 Год назад

      *objects.all*if am not wrong

  • @jadrianverkouteren3799
    @jadrianverkouteren3799 2 месяца назад

    I do makemigrations and the cmd screen says "No installed app with label 'main'."

  • @delivaapp7068
    @delivaapp7068 2 года назад

    Hie, Tim , is there a way to generate an ERD from an already existing django sqlite3 database?

  • @yeetpizza7452
    @yeetpizza7452 3 года назад

    just a quick thing why do you have to use a virtual environment it is really puzzling me because i cant figure out why?

  • @mr.mikaeel6264
    @mr.mikaeel6264 4 года назад +1

    Isn't it much easier and less time consuming to just create an app to use inside the pre-built Django admin area and add queries to the db from there? Ive used both methods and i make alot of typos so honestly adding queries in the shell can be frustrating. Plus with an app you dont need to write the lines of code everytime in the shell as everything is easily modifiable from the admin GUI. Anyway, just a noobs idea here. Probably smth i'm overlooking.

  • @monicacolling2399
    @monicacolling2399 2 года назад

    I've followed along with every step and went back to verify everything is typed correctly. I'm at 17:54, and I'm getting an error screen when I put in /(insert any number) ---- as in literally placing any number there. TypeError at /1
    index() got an unexpected keyword argument 'id'

  • @eng.hasanyousif1161
    @eng.hasanyousif1161 5 лет назад +3

    dear tim when i type t.save() its give me an error do think because iam using python 3.7

    • @jacobccooper
      @jacobccooper 5 лет назад +1

      do you figure it out im having this too

    • @phhoangquan3187
      @phhoangquan3187 4 года назад

      i have table Z_todolist has no column named name Error:(((( could you solve it

    • @aldaineclarke755
      @aldaineclarke755 4 года назад

      I have python 3.7..and it works fine..just follow the error..it usually gives an explanation

    • @ayoubZaZen
      @ayoubZaZen 4 года назад

      bro i have the same error
      did you fond the slotion

  • @ambientsoda106
    @ambientsoda106 5 месяцев назад

    how do you delete your project/ virtual environment when you no longer want the project?

  • @bpera1
    @bpera1 11 месяцев назад

    I want to create items. Some are integers and some are names. How do I do that in shell

  • @pedrofontoura8119
    @pedrofontoura8119 4 года назад +2

    hayo, i have a problem with the python "manage.py migrate" it says that havent any migrations to aply, and i havent done this before what i do?

    • @shyren_more
      @shyren_more 4 года назад

      have you executed python manage.py makemigrations before ?

    • @pedrofontoura8119
      @pedrofontoura8119 4 года назад +1

      @@shyren_more never

    • @shyren_more
      @shyren_more 4 года назад +1

      @@pedrofontoura8119 yeah then first execute
      python manage.py makemigrations
      This kinds of stage your changes and to apply those changes(Models created or anything else) execute
      python manage.py migrate
      Hope this helps

  • @sainco3036
    @sainco3036 5 лет назад +1

    thanks.

  • @abdullahalnoman2577
    @abdullahalnoman2577 2 года назад

    Hi Tim, how do I connect an exsiting database to my current django project?

  • @hadimasri420
    @hadimasri420 5 лет назад +1

    10 mins late ..🤩😍

  • @kei5985
    @kei5985 3 года назад

    Me trying to make a really nice website while wix is out here literally doing the same thing but better

  • @thomaspynchon8400
    @thomaspynchon8400 4 года назад +1

    I can't save the object for some reason. 😣

  • @Harsh-fd4ml
    @Harsh-fd4ml 3 года назад

    Go to the mall 😂 Robin is that you

  • @annadonts
    @annadonts Год назад

    hi! i'm getting an attribute error during t.item_set.all(), can someone tell me why it doesn't work for me when i have done the exact same thing as Tim did? :(

  • @PhucThinh1505
    @PhucThinh1505 2 года назад

    I just got and solved an issue with the 'max_Length', it should be in the lower key right? so I wonder how did you not face an error when you make migrations for the main app?

    • @ziaadkn6387
      @ziaadkn6387 Год назад

      Over a year late but, it was in lowercase but lowercase and uppercase are similiar due to Sublime Text font as it was not intended for tutorials

  • @weixiangzhao561
    @weixiangzhao561 2 года назад

    Hi Tim,
    when I do t.item_set.all()
    it shows:
    OperationalError: no such column: main_item.complete
    Could you tell me what is wrong?

  • @pizzaman6999
    @pizzaman6999 4 года назад +1

    Sir, how you created that model page back in the beginning

    • @Astrous
      @Astrous 4 года назад +1

      It should come auto when u are making the app

  • @katerynamisik7601
    @katerynamisik7601 3 года назад

    It is an error when I try to add some lists, 10 min in the video... Thank u in advance

  • @fazlensaleha8929
    @fazlensaleha8929 5 лет назад +1

    At 3.30am. 😎

  • @katerynamisik7601
    @katerynamisik7601 3 года назад

    this tutorial doesn't work very well.. the home page is crashed after changes in views & urls ... :'(

  • @vustudent5569
    @vustudent5569 Год назад

    can you help me please in connecting mysql in django?

  • @divyanshu8874
    @divyanshu8874 4 года назад +1

    Bro one humble request actually I am from India we are not that proficient in English.pls speak slowly so that we can understand.

    • @eduardsandersons8793
      @eduardsandersons8793 4 года назад

      just choose a slower playback speed

    • @suyashvashishtha4904
      @suyashvashishtha4904 4 года назад +1

      Bro don't say "We" . Just say i am not able. And in start i was also not able to.... But reduce the play back speed

  • @pjmclenon
    @pjmclenon 4 года назад

    hello, dont we have to do 1. python3 manage.py makemigrations webapp 2. python3 manage.py sqlmigrate webapp 3. python3 manage.py migrate webapp ??? thxz alot Lisa

  • @midnightdishwasher1071
    @midnightdishwasher1071 2 года назад

    mine says object has no attribute the item_set

  • @Walikanani
    @Walikanani 3 года назад

    why use "L" in modeLs.ModeL and on_deLete? it just seemed to cause me errors

  • @davideettori3226
    @davideettori3226 5 лет назад +1

    When a type migrate it tells me that i don't have a virtual environment
    Do you know why ??
    And when i type activate dj it tells me 'could not find conda environment: dj'

    • @TechWithTim
      @TechWithTim  5 лет назад

      Don’t worry about the virtual environment I just use one for my installation you don’t need it

    • @davideettori3226
      @davideettori3226 5 лет назад

      @@TechWithTim ok but it keep saying that i can't migrate anythingh without a virtual environment

    • @TechWithTim
      @TechWithTim  5 лет назад

      okay then create a virtual environment, activate it and try:
      $ conda create -n dj python=3.6
      $ activate dj
      $ python manage.py migrate
      (don't include $)

    • @davideettori3226
      @davideettori3226 5 лет назад

      Thank you very much but i have one last question. :)
      Now it say that he can't import django but i have already typed 'pip install django'
      Sorry if i am annoying you

    • @chawong5860
      @chawong5860 5 лет назад

      @@davideettori3226 try conda install django

  • @abdulwadudkhan684
    @abdulwadudkhan684 8 месяцев назад

    Hey you just make a mistake or some thing else because in this what you thought it's not plzz make what you put on the mysite urls section plzz it lots of confusion 😊

  • @OpGamerz-qz4yz
    @OpGamerz-qz4yz 3 года назад

    the Item Function is not working

  • @jimrakel418
    @jimrakel418 5 лет назад

    Finished creating the models file, typed python manage.py makemigrations main and I get a reply back, 'no installed app with label 'main'. when I do python manage.py migrate, it says Apply all migrations: admin, auth, contenttypes, sessions. I even spent considerable time double checking my spelling and it is correct. Any ideas on how I can fix it?

    • @patyearick6821
      @patyearick6821 5 лет назад

      Got me also. Tim should refer to his django setup tutorial: techwithtim.net/tutorials/django/setup That is where he does the Python "manage.py startapp main" and that creates the main.

    • @SafikMaster
      @SafikMaster 5 лет назад +2

      For people reading in the future, I had that problem because I didn't save the settings.py file. After adding 'main.apps.MainConfig', to the settings file it somehow updates for Tim without saving. For me each change that I make I have to save it and then run the cmd command again and it works.

  • @aman65b
    @aman65b 3 года назад +1

    Everything works except
    items = ls.item_set.get(id=1) --> error "Item matching query does not exist"
    however, if I do,
    items = ls.item_set.get(text="this text")
    it works.
    Don't know why.

    • @arjunreddy6867
      @arjunreddy6867 3 года назад

      Had the same issue.Have u found out what the problem was??

  • @marekkarasz3776
    @marekkarasz3776 4 года назад

    yeah well, I have an error on my screen says that ToDoList has no attribute. I follow along with this video and this is 3rd time something not working even though I did everything you said. Just like in previous videos. I should probably watch somebody else

    • @mr.mikaeel6264
      @mr.mikaeel6264 4 года назад

      Watch from 19:00 make sure this is correct the views.py and also check if the urls.py is correct. Might just be a ; or ) that's missing.

  • @greetingsgentlemen.8179
    @greetingsgentlemen.8179 3 года назад

    where is next video please?

  • @faran_9
    @faran_9 4 года назад

    Problem :
    ToDoList.objects.get(.....)
    gives error:
    Class 'ToDoList' has no 'objects' member
    Can anyone help?

    • @5ithofnov159
      @5ithofnov159 4 года назад

      did you migrate the models? first make migrations and then migrate did you import from main.models? are your paths correct?

    • @tharikhajar
      @tharikhajar 4 года назад

      @@5ithofnov159 Having the same issue here. Trying to makemigrations again tells me that there are no changes detected, and "No migrations to apply" when I try to migrate.

  • @classicguy7813
    @classicguy7813 5 лет назад

    django.db.utils.OperationalError: no such table: blog_mrsorrow :(
    My table not appears after many attemps

    • @harisrama1
      @harisrama1 5 лет назад

      have u solved this yet bc i get the same thing

    • @classicguy7813
      @classicguy7813 5 лет назад

      There is no use if you has given "fake migrations" command. Just delete all django start the app again

    • @classicguy7813
      @classicguy7813 5 лет назад +1

      @@harisrama1 Yes Sir! You need to delete all migrations in all files all apps. Then you need to: PROJECT içinde APP yani MODULE oluşturma
      cd C:\Users\MSI\Documents\webpy
      python manage.py startapp blog
      y
      python manage.py migrate
      PROJECT içinde APP yani MODULE oluşturma
      cd C:\Users\MSI\Documents\webpy
      python manage.py startapp users
      y
      python manage.py migrate
      python manage.py makemigrations
      python manage.py migrate

    • @hrushikesh-1914
      @hrushikesh-1914 4 года назад

      @@classicguy7813 it worked to me..thanks 😊😊

    • @FAB199191
      @FAB199191 3 года назад

      I know it's a late answer, but you just can delete the DB, the contents of the migrations and all pychache folders and do makemigrations and migrate again. Then it should work

  • @zutoebola4922
    @zutoebola4922 4 года назад

    Do you even know how to make a multiple item query?

  • @tharunjannu
    @tharunjannu 4 года назад

    __init__.py error
    Import Module error

  • @TheLOLFactory-u5z
    @TheLOLFactory-u5z 2 года назад

    Your videos and Corey's are too similar. The vibes and all is just the same. You guys teach too well.

  • @reer-r5b
    @reer-r5b Год назад

    can you speak chinese

  • @deki90to
    @deki90to 4 года назад +5

    you need to talk slower and commit to explaining stuff, dont just run, this mean nothing to us

    • @Linuxovert
      @Linuxovert 4 года назад +1

      RUclips developers heard your complaining and invented the Playback Speed feature to control the speed of the video, you can find it in the setting

    • @deki90to
      @deki90to 4 года назад +2

      @@Linuxovert So if I slow down the video, there is MORE to learn? Don't try to be smart, you are not

  • @seanrosario5223
    @seanrosario5223 4 года назад +1

    this was a bad tutorial

  • @TSUinformatca_UPTMA
    @TSUinformatca_UPTMA 4 года назад

    thanks.

  • @kavithareddy4774
    @kavithareddy4774 5 лет назад +1

    I'm getting error as : module django. db.models has no attribute foreignkey

    • @vihashah5975
      @vihashah5975 4 года назад

      check capitalization its ForeignKey

  • @sajanmahat4764
    @sajanmahat4764 4 года назад

    where is the next video please