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.
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.
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.
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.
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.
@@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
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?
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.
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
@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!
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.
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.
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.
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.
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'
@@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
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? :(
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?
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
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'
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 $)
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
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 😊
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?
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.
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.
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.
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
@@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.
@@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
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
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.
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
I will watch every ad Tim just to give something in return. Thank you for all of your tutorials!
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.
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.
Thank you JoJo!! i had that same issue and you saved me!
Thanks 🙏
Thanks man
saved me from frustration
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.
Redid the last 2 video and got almost everything working for me. Hopefully it will come together with the next video.
Just best video instruction. Thanks a lot. And... you changed after 5 years 😊
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.
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.
Yeah, this video doesn't explain everything. This video is only for suckers
make five to ten diferent basic projects and then you get it, just dont quit
@@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
@@v_vijay_krishnan it is a great video, you are not great student
This is by far the best tutorial I have found yet!
I thought I was ready for this o.O Back to basics...
Edited : Worked thanks ur a life saver
you are really the best to explain things
I tried that with mysql no problem at all❤❤❤❤❤❤
Thanks a lot this is Great!
U re always awesome man
Nice bro keep it up........
1:16 the configuration path is important when dealing with templates and custom html
12:02 the way he said "memory address" just killed me XD
Thank you for these amazing videos! You explain things very well :)
Best tutorial for begginers!
讲的非常好,点赞!👍
Thank you!
Большое спасибо, очень помогло!
Great video
I love this video series
Great stuff Tim, thanks.
Thank you so much
Hey, in html you don't need to put , with one it already works ()
nice bruh.............after 4 years
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?
Thank you so much ! Can you show me how to create a database view in sqlite and use it in django ?
please my ToDoList is indicating an error, "ToDoList has no objects".
ls = ToDoList.objects.get(id=id)
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)
wow like i'm really getting things
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.
I am getting error "table main_todolist has no column named name" @ t. save( ) 10.36
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
Please make a video for quiztest in django with SQLite
@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!
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.
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.
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.
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.
it should be max_length() I think
the L in the max length should be lowercased
I'm with the same error, I didn't find nothing wrong. Could someone help me?
Hi friend, I solved it, you wrote the word 'length wrong. Check it out.
my item_set.all() doesnt work
same here
Did you got it right
When i do
" ToDoList.object.all()"
The output is
Instead of object name, did i do something wrong ?
Thank you in advance
am also having the same challenge did you figure it out?
@@kundamwenje2224 no brother i try id and other stuff but it won't work.
*objects.all*if am not wrong
I do makemigrations and the cmd screen says "No installed app with label 'main'."
Hie, Tim , is there a way to generate an ERD from an already existing django sqlite3 database?
just a quick thing why do you have to use a virtual environment it is really puzzling me because i cant figure out why?
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.
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'
dear tim when i type t.save() its give me an error do think because iam using python 3.7
do you figure it out im having this too
i have table Z_todolist has no column named name Error:(((( could you solve it
I have python 3.7..and it works fine..just follow the error..it usually gives an explanation
bro i have the same error
did you fond the slotion
how do you delete your project/ virtual environment when you no longer want the project?
I want to create items. Some are integers and some are names. How do I do that in shell
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?
have you executed python manage.py makemigrations before ?
@@shyren_more never
@@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
thanks.
Hi Tim, how do I connect an exsiting database to my current django project?
10 mins late ..🤩😍
Me trying to make a really nice website while wix is out here literally doing the same thing but better
I can't save the object for some reason. 😣
Go to the mall 😂 Robin is that you
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? :(
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?
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
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?
same issue here
btw did u find any solution?
Sir, how you created that model page back in the beginning
It should come auto when u are making the app
It is an error when I try to add some lists, 10 min in the video... Thank u in advance
At 3.30am. 😎
this tutorial doesn't work very well.. the home page is crashed after changes in views & urls ... :'(
can you help me please in connecting mysql in django?
Bro one humble request actually I am from India we are not that proficient in English.pls speak slowly so that we can understand.
just choose a slower playback speed
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
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
mine says object has no attribute the item_set
why use "L" in modeLs.ModeL and on_deLete? it just seemed to cause me errors
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'
Don’t worry about the virtual environment I just use one for my installation you don’t need it
@@TechWithTim ok but it keep saying that i can't migrate anythingh without a virtual environment
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 $)
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
@@davideettori3226 try conda install django
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 😊
the Item Function is not working
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?
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.
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.
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.
Had the same issue.Have u found out what the problem was??
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
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.
where is next video please?
Problem :
ToDoList.objects.get(.....)
gives error:
Class 'ToDoList' has no 'objects' member
Can anyone help?
did you migrate the models? first make migrations and then migrate did you import from main.models? are your paths correct?
@@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.
django.db.utils.OperationalError: no such table: blog_mrsorrow :(
My table not appears after many attemps
have u solved this yet bc i get the same thing
There is no use if you has given "fake migrations" command. Just delete all django start the app again
@@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
@@classicguy7813 it worked to me..thanks 😊😊
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
Do you even know how to make a multiple item query?
__init__.py error
Import Module error
Make sure you added app in settings.py
Your videos and Corey's are too similar. The vibes and all is just the same. You guys teach too well.
can you speak chinese
you need to talk slower and commit to explaining stuff, dont just run, this mean nothing to us
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
@@Linuxovert So if I slow down the video, there is MORE to learn? Don't try to be smart, you are not
this was a bad tutorial
thanks.
I'm getting error as : module django. db.models has no attribute foreignkey
check capitalization its ForeignKey
where is the next video please