Mr Brian is a Brillant teacher and the build up of the lesson apps is awesome,No wonder they produce whole new level of brillant pass out students with the teaching faculty and clarity of subject like this.Thank you so much Harvard and the biggest gift of our time " The internet".
A very dense and totally meaningful course! Instead of wasting time on nonsense coding bootcamps (html, css, python and Django) here you see the total pure logic background and create totally generic pages, submit buttons that does something and things changes according to input... I loved and each 5 mins or so wanted to press on the like button (first time ever) :)))
Brian should have his own software development learning startup and expand the content not covered on cs50! He'll give a real treasure to this world and earn 100 of millions if not billions doing so!
Brian is the best online teacher for me. i connect with his way of teaching so much that i understand everything he teaches so easily. i don't think i've enough words to thank him for this. God bless Brian
Around 25 min, when you already have dedicated views for Brian and David then I think you should prioritize them in first and the generic greet view comes later only in defining URLs paths. This is not an error but makes different logical outputs. I am really thankful for your teaching.
I was procrastinating while learning Django alot nothing new always happens to me , I was learning by Dj docs tuned this course on I have been studying for like 4-5 hrs now Brian got me hooked mann literally I wish i had a ai bot like brian that explained me everything i needed to know in my life
I suppose the collision error, 1:10:08, was somewhat intentional to explain the next steps in those cases. But in this part 54:07 you can look at settings.py tasks is added at the end (after newyear) and at 54:13 urls.py tasks/ is NOT added at the end but before newyear/, hence the error. * I put tasks in both cases (settings.py and urls.py) after newyear and there was no error.
1:36:25 why it doesn't work if we utilize append like this??? request.session["tasks"].append(task), it only works if we write request.session["tasks"] += [task]
Год назад
estou aplaudindo esse curso com os pés porque com as mãos estou programando
at 1:36:17 when Brian changes the add function to, instead of updating the (deleted) global variable, update the task list in the session - why are we using this syntax += [task] ? I know that the += is shorthand for append, but why is 'task' , that is obtained from the cleaned_data of the form and is a string, not simply appended to request.session["tasks"]] which is a list via the .append() method? If I use request.session["tasks"].append(task) it doesn't work. I'm trying to understand why..... request.session["tasks"] = a list task = a string I should be able to use the append method on the list to append the string. I'm clearly missing something here. Anyone that can explain this?
Made a stackoverflow question for this because it was bugging me and in the video Brian just 'acts like this is normal syntax' :) stackoverflow.com/questions/63449525/append-to-request-sessionslist-in-django/63477092#63477092
hey, when you use .append() the session by default won't be saved. Documentation here: docs.djangoproject.com/en/2.2/topics/http/sessions/#when-sessions-are-saved I'm not sure, but it seems the syntax Brian used gets around that and forces Django to save the session without having to explicitly say: request.session.modified = True.
There's a minimal logical error at the end since the "request.session[tasks]" only creates if the user goes first to the url "/tasks/", however if the user goes first to the url "/tasks/add" , the "request.session[tasks] is not created, so if the user tries to add a new task, it won't work. just a little observation, it was a great lecture
Yes, but add in def add(request): if "tasks" not in request.session: request.session["tasks"]=[] and this work fine! (if the user goes first to the url "/tasks/add")
Taking this course has gotten me into a lot of frustrations and errors I can’t even understand even when doing the exact same thing that Brian does it’s just makes me sick.
hey, when you use .append() the session by default won't be saved. Documentation here: docs.djangoproject.com/en/2.2/topics/http/sessions/#when-sessions-are-saved I'm not sure, but it seems the syntax Brian used gets around that and forces Django to save the session without having to explicitly say: request.session.modified = True.
append(): This does not work request.session["tasks"].append(task) but this work list_tmp = request.session["tasks"] list_tmp.append(task) request.session["tasks"] = list_tmp : )
I usually skip long videos but this thisss was totally worth it. a 1000 blessings to you. also whoever was in charge of the camera movements blew my mind.
How can he just do a lecture for nearly 2 hours straight with so much energy. I would fall asleep in the first 5 mins if I was him. Anyway I learnt alot from this lecture
@@Diversecricket2.0 IDK, are you sure you created the template folder the same way Brian did??? hello/templates/hello/ and inside here create the html files? if you did it exactly the same it shouldnt throw errors, and restarting the server should be enough
@@isidoraaxis6179 I am getting this error when we create just the Hello World website. I tried solutions from youtube and google but those didn't work.
Hey all, wondering if anyone is having the same issue as I am. I'm using Django 4.04 and when trying to recreate the namespace error, I can't. My project works fine without having to add in 'app_name = "tasks"'. That said, whenever I try to code along verbatim, I get 'tasks is not a registered namespace'.
copy paste my code in views.py and it will work: from http.client import HTTPResponse from django.http import HttpResponse from django.shortcuts import render # Create your views here. def index(request): return HttpResponse("Hello, world!")
the best way is to use dev tools in your browser and check the input fields and then grab predefined attributes. this works for me......very well..... but if you want use django thing use django widgets to set attributes first then use them in your css
I had the same result and did some experimenting. It is certainly not random. Django seems to look in in the 'last url in the project's urlpatterns list' first. (lecture3/urls.py) In your lecture3 project 'urls.py', if you change the list as follows: urlpatterns = [ path('admin/', admin.site.urls), path('tasks/', include("tasks.urls")), path('newyear/', include("newyear.urls")), path('hello/', include("hello.urls")), ] so that 'hello' is last (recall that the hello APP also has a path with a name of 'index'). If you would now link to url 'index' - django will always go the index url of the hello APP. As you can see at 54:10 , Brian (probably on purpose to drive his point home later) puts the path for tasks BEFORE the newyear path in the urlpatterns list. You and I added it to the end of the list and as such we did not produce this problem. Having said all of that - it is good practice to name your apps so you can explicitly link to them.
I'm completely lost, couldn't follow along the Django installation and all the commands. I'm using Windows and wish to set up VS Code to use the terminal but i haven't found any useful docs / tutorial regarding the set up. Can anyone help?
On youtube I followed a tutorial from a guy named Tubemint for a python and django setup on windows. From there I installed vscode, and once I had python and django running I created my project and went to the cmd window and typed code . (remember there is a space and a period after code) which automatically opened my project on vs code. You can even open up the project folder on vs code and it will show every file for the project that way as well.
If you're on Windows I would highly recommend installing a bash environment program like Git Bash (included in Git for Windows) or Windows Subsystem for Linux. The commands that Brian uses in his zsh shell can be done verbatim in your bash shell.
I'm following up with this series after I finished the Introduction to Computer Science, I've got a drawback on the static css linking, I'm following all the procedures but doesn't link up, I'm trying to link the css file with the static method but it ain't applying. Can anyone help?
A bit late, but make sure you put the line "{% load static %}" at the top of your HTML template, and the line "" inside the head tag. And also make sure the HTML template is inside a folder "app_name" (hello/newyear/etc), which itself should be inside a "templates" folder.
Oh no guys it's so much more complicated than flask like 10x times more counter intuitive, i think this is where I'm gonna stain my model student streak 🤦, can you guys put flowers on my grave?