Django Tutorial #3 - URLs and Views

  Рет қаралды 190,544

Net Ninja

Net Ninja

Күн бұрын

Пікірлер: 167
@kbprojekty
@kbprojekty 5 жыл бұрын
What makes your videos great is that you first explain the top-down view of the whole thing and then get to details. To be able to easily understand something, I first need to understand what it is and why am I doing it. How something works before details and procedures. You're doing this very well, thanks for your videos, you made my learning day a lot easier! ;)
@efexzium
@efexzium 9 ай бұрын
That’s the best way to teach
@patientson
@patientson Жыл бұрын
Thank you very much. The diagram was the super star which helped the word in my mind to find peace with the concept. Now, you have cut my work down to where I can continue from.
@TaHrPa
@TaHrPa 2 жыл бұрын
I'm enrolled in an academy for software development, they have web development with django course and I also watch a lot of youtube and udemy videos. I've been learning django for a few weeks and I have to say your videos are far superior to everything I've seen so far.
@maxconstable2535
@maxconstable2535 2 жыл бұрын
I was just about to type the same. Everything I found on the courses seemed almost impersonal and just "this is what you do", rather than why. These videos are 100x better and I'm so glad they're here
@mrgrade3_
@mrgrade3_ Жыл бұрын
Same here brother
@temprmj1
@temprmj1 7 жыл бұрын
Excellent teaching style, not too fast and not dumbed-down either
@NetNinja
@NetNinja 7 жыл бұрын
Thanks so much :). Glad you like.
@alanmoreno6330
@alanmoreno6330 2 жыл бұрын
@@NetNinja ohh yeahh i likeyy
@mixfruit000
@mixfruit000 2 жыл бұрын
teaching style is best best best...................................
@Iwincash
@Iwincash 2 ай бұрын
When you said "ok makes sense" it triggered something in my brain that made me pay attention x10. I even answered outloud, yes sir it makes sense thank you. I followed shortly after. Great video
@pythonwithpower5664
@pythonwithpower5664 3 жыл бұрын
This course was recommended to me by someone and I couldn't be happier, definitely going to finish the entire tutorial. Thanks, you're great!
@vinayakad3796
@vinayakad3796 3 жыл бұрын
Will definitely recommend this to anyone who doesn't understand Django!!! This playlist is a gem
@tunasalad3919
@tunasalad3919 6 жыл бұрын
you're literally saving somebody's day by doing this. Kudos...I wish everybody should have taught me like this.
@tunasaaalad
@tunasaaalad 2 жыл бұрын
Hi man, greetings from Russia. Just wanted to tell you explained all this stuff much better than any Russian textbook that is always written in soviet-thus-impossible-to-understand style even though it's 21st century already. THANK YOU for your django tutorials!
@lancemkhokhelidube6076
@lancemkhokhelidube6076 3 жыл бұрын
DUUUUUUUUDE i literally understand and follow everything you are teaching...I've watched a few other Django tutorials but was never able to make a simple page...today I MADE FREAKIN 20 pages
@NetNinja
@NetNinja 3 жыл бұрын
Thanks so much and that's awesome! 😃
@Boopadoopap
@Boopadoopap 7 жыл бұрын
This has been the best, most clear tutorial on django I've seen yet. Thanks a ton!
@NetNinja
@NetNinja 7 жыл бұрын
Thanks :)
@neosinan1
@neosinan1 3 жыл бұрын
Last night I read official django page and stackoverflow for 3 hours and I couldnt solve my problems. I took 2 minute and 27 second of this video was enough. Thanks.
@jerrymardeburg9313
@jerrymardeburg9313 2 жыл бұрын
You are the best tutor I have seen so far The way you breakdown everything to basis is amazing. Much Love
@NetNinja
@NetNinja 2 жыл бұрын
I appreciate that! Thanks jerry :)
@user-ph2bc8kc6c
@user-ph2bc8kc6c 5 жыл бұрын
Amazing tutorial! especially thanks to covering every little step as explain the "from . import views" which explain that "." means a reference to the working directory. Also the names' convention is beautifully done. Thank you!
@taihatranduc8613
@taihatranduc8613 5 жыл бұрын
wow. you make it so much easy to understand. you're completely different from all KZbinr i know. what a great teacher!
@NetNinja
@NetNinja 5 жыл бұрын
Thanks so much 😊
@WorldUpdates4U
@WorldUpdates4U 4 жыл бұрын
Sir you are brilliant by watching your videos I built confidence and now I am capable enough that I can clear out my interview.
@paulthompson3156
@paulthompson3156 4 жыл бұрын
Well explained. Thank you ! It was great the way you explained WHY you are doing something. Not just HOW to do something.
@ankushchavhan1332
@ankushchavhan1332 2 жыл бұрын
Hey man you are giving such valuable material for free 🙂. You dropped your 👑
@piotrz6872
@piotrz6872 3 жыл бұрын
You really know how to walk people through by the hand. Thank you for prepering this course.
@ianpan0102
@ianpan0102 5 жыл бұрын
Love the diagram you showed at the beginning, I'm going to use this too tomorrow in my class!
@Peekaymaja
@Peekaymaja 6 жыл бұрын
Best series ever. I thought django is difficult. I'm excited to learn more. Thank you very much man keep up the good job
@rahulparmar208
@rahulparmar208 6 жыл бұрын
This process i hv been trying to learn for last 1 week.. Finally thanks tobu bro.. I got thr zest of it now.... Superb
@akakop
@akakop 4 жыл бұрын
This is one of the best tutorials on django
@beresfordsylvah8874
@beresfordsylvah8874 3 жыл бұрын
Am greatful, you made me understand this views and urls syntax in just minutes.👏
4 жыл бұрын
Thank you net ninja for the explanation however 9:00 how is the function been fired when you are only referencing the object function name and not calling it when you do view.about instead or view.about( ) which would require one parameter and also is it just a must to put a request object in the function eg about got a request. or what is the magic going on that i dont get
@Timbo101001
@Timbo101001 6 жыл бұрын
This made me understand what I've been trying to understand for ages. Hero.
@Дмитрий_Селин
@Дмитрий_Селин 6 жыл бұрын
к сожалению я английским языком не владею, но просто глядя на схемы, я понял принцип работы Django. Большое спасибо.
@AshishSharma-pm1dc
@AshishSharma-pm1dc 6 жыл бұрын
Bro you have explained this in such a good manner.Subscribed😁
@NetNinja
@NetNinja 6 жыл бұрын
Thanks man, glad you liked :)
@atirrasheedhashmi
@atirrasheedhashmi 2 жыл бұрын
9:30 "request" is not accessed by pylance Why & it's not updating the page after running python manage.py runserver in cmd Help me :(
@birdstheword5
@birdstheword5 6 жыл бұрын
thanks so much for explaining what you are doing while you are doing it, nothing was making sense until I found this tutorial :)
@jetspray3
@jetspray3 5 жыл бұрын
even though i understand function views, however that was the best explanation every from all the other videos on youtube. I hope you have a video with generic views.
@seth4402
@seth4402 6 жыл бұрын
This is great stuff. Any chance you'll be updating the tutorial to version 2 of Django? I think the new version uses path() instead of url(), at least according to the documentation tutorial.
@adityadwivedi4405
@adityadwivedi4405 5 жыл бұрын
Nice tutorials dude. No bs directly to point 👍
@MB-qk1bj
@MB-qk1bj 5 жыл бұрын
Thank you very much for this wonderful tutorial, i was so lost now everything makes perfect sense thank you so much
@sandunnirmala9269
@sandunnirmala9269 7 жыл бұрын
i am getting this error in cmd. How to solve this sir AttributeError: module 'myweb.views' has no attribute 'homepage'
@ifargantech
@ifargantech 4 жыл бұрын
Now being on home I can access the login path... but after being on the login path I can't access the home path... It says 127.0.0.1:8000/login/home doesn't exist. How I can leave the login ?
@sangharshadhital6017
@sangharshadhital6017 6 жыл бұрын
path(r'^$',home) does not work on my pycharm? it works without using r'^$' symbol... why is it so?
@haritpatel5001
@haritpatel5001 3 жыл бұрын
You are awesome Shawn love form India.
@jisgerald8723
@jisgerald8723 4 жыл бұрын
Although this video dates back, thanks a bunch!!!👍🏽
@ifiokekott2684
@ifiokekott2684 3 жыл бұрын
Abi, I'm wondering what version of Django is that?
@StoneZhong
@StoneZhong 5 жыл бұрын
this demo is about django 1.x, the most recent django version is 2.1.7 as of today, I think people uses something like "urlpatterns = [ path('', views.index, name='index'), ]" for django 2.x
@nhanLe_
@nhanLe_ 3 жыл бұрын
Excellent, keep up the good work
@baseh6272
@baseh6272 5 жыл бұрын
Awesome teaching style
@hardeeraval5770
@hardeeraval5770 3 жыл бұрын
Page not found (404) Request Method: GET Request URL: bnyrj.pythonanywhere.com/ Using the URLconf defined in mysite. urls, Django tried these URL patterns, in this order: polls/ admin/ The empty path didn't match any of these. You're seeing this error because you have DEBUG = True in your Django settings file. i m getting this error pls give me solution
@virtualgirl7697
@virtualgirl7697 5 жыл бұрын
Excellent explaination..so much simplified
@TheBurningofSolomon
@TheBurningofSolomon 6 жыл бұрын
Incredible tutorials, friend. Subscribed mate
@etiennelauzier5698
@etiennelauzier5698 7 жыл бұрын
You rock !!!!!! Excellent job my friend!!! May science bless you.
@yusufrumi1626
@yusufrumi1626 4 жыл бұрын
Thanks so much. Very well explained.
@anroiduser1222
@anroiduser1222 4 жыл бұрын
I have learned a lot and feel cool, you are good mate!
@aghiadalzein3069
@aghiadalzein3069 5 жыл бұрын
The most clear explanation ,thanks a lot.
@Anom21
@Anom21 4 жыл бұрын
Hey man, it was a big help, can't thank you enough
@yassir3715
@yassir3715 6 жыл бұрын
in django 2.0.7 when I use regular expressions to setup URLs that ends up with django responding with an Error instead of the specified response in the views.py file, so we don't use regex any more?
@mindpower421
@mindpower421 6 жыл бұрын
amazing video, one of the best video on this planet
@nightingalenath943
@nightingalenath943 6 жыл бұрын
Please the creating the project am not able to get the; from django.conf.urls import urls, but rather from django.urls import path. So am not able to follow you on this tutorial. Please help me and i will be grateful. Thanks
@damniexist51
@damniexist51 7 жыл бұрын
its urlpatterns = [ path('admin/', admin.site.urls), ] for me whats the difference?
@NetNinja
@NetNinja 7 жыл бұрын
Hey, path is the Django 2 version. The only difference using path instead of URL is that you don't need RegEx for the url structure :)
@damniexist51
@damniexist51 7 жыл бұрын
thanks
@damniexist51
@damniexist51 7 жыл бұрын
:)
@gilfalkovitch9669
@gilfalkovitch9669 6 жыл бұрын
There's something weird... If the "about" function requires a "request" parameter, how come it does not error out as you call it WITHOUT passing one?
@dhruvpendharkar488
@dhruvpendharkar488 4 жыл бұрын
Why is request not a required paramater n Http Response method . For example it is a parameter in render method for templates.
@dirtymopwater2868
@dirtymopwater2868 6 жыл бұрын
This was very clearly explained. Thank you
@joyaljoseph7781
@joyaljoseph7781 4 жыл бұрын
What do settings.py and manage.py do? Can I get the full code of those files?
@miguelnuno928
@miguelnuno928 4 жыл бұрын
You help me a lot. Thank you for share your knowledge
@rameshmathad
@rameshmathad 6 жыл бұрын
the runserver gives NameError: name 'path' is not defined along with 100 other lines of errors waht to do please help ..../?
@devanshsolani2593
@devanshsolani2593 4 жыл бұрын
Error I am getting is, when in cmd I type "python manage.py runserver", It does not start the server.
@oblivion1111
@oblivion1111 4 жыл бұрын
make sure you cd in the src of the Dev folder and type source bin/activate and then type the runserver again
@ravabat5841
@ravabat5841 4 жыл бұрын
@@oblivion1111 yep, it's true
@maryuma881
@maryuma881 4 жыл бұрын
You should try install python properly by using Windows Store, and add django scripts into PATH
@yashv2000
@yashv2000 3 жыл бұрын
Best series, ngl
@increadibleangel7980
@increadibleangel7980 4 жыл бұрын
Does any changes for 2020 version? Or it wil work
@happy_cutman
@happy_cutman 5 жыл бұрын
Thanks for video! What kind of font you use in Atom?
@joebegleycodes1347
@joebegleycodes1347 6 жыл бұрын
The regex portion for the URLs didn't work for me. To fix the issue use re_path instead of path. First, put this up top "from django.urls import re_path" Then, use "re_path" instead of "path"
@JojYTHandle
@JojYTHandle 6 жыл бұрын
Thanks for posting this, I was confused
@joebegleycodes1347
@joebegleycodes1347 6 жыл бұрын
url instead will also work. He changed it between the videos.
@bastonalexandru
@bastonalexandru 5 жыл бұрын
Great tutorial m8, you helped me a lot! Thank you :D
@definty
@definty 4 жыл бұрын
Isn't the 'r' to show its a regular expression, what's a raw string?
@m.jsoltani8133
@m.jsoltani8133 4 жыл бұрын
what about venv ?? virtual environment is not necessary in Django?
@javierlizarazu7680
@javierlizarazu7680 6 жыл бұрын
what version of django are you using? can i follow the tutorial with django 2.0.7 installed?
@rahulparmar208
@rahulparmar208 6 жыл бұрын
Can u please for a fresher what shud i know before applying for interviews for bavend python developer job
@user-cc8kb
@user-cc8kb 4 жыл бұрын
Amazing. Thank you very much! :)
@arturofm
@arturofm 6 жыл бұрын
Ninja I love your tuto, but this one is kind of outdated now with Django 2, and the path vs url, are you planning to update it? Thanks for the good work
@ravabat5841
@ravabat5841 4 жыл бұрын
Hello, what the different between HttpResponse and render function? Thank you
@syntaxis5584
@syntaxis5584 4 жыл бұрын
render is a wrapper function that uses HttpResponse to render a view
@OliverCao
@OliverCao 4 жыл бұрын
you are a real G
@aliaksandrhn1
@aliaksandrhn1 2 жыл бұрын
I just love how the British pronounce the letter "H". Epic.
@VadimBesedin
@VadimBesedin 6 жыл бұрын
In newer version of Django, in views.py, instead of: return HttpResponse('about') use: return render(request,'about.html')
@studiozandra8714
@studiozandra8714 5 жыл бұрын
thank you, Vadim!
@adityadwivedi4405
@adityadwivedi4405 5 жыл бұрын
You also need to include frome django.shortcuts import render
@ImtoolVideos
@ImtoolVideos 7 жыл бұрын
My understanding is that in about a week or two regex will no longer need to be used -with the new release dropping in December
@NetNinja
@NetNinja 7 жыл бұрын
You're absolutely correct :). In django 2 url params will be much easier to use.
@kewang08
@kewang08 6 жыл бұрын
can you redirect me to understand the url params? which is path. quite confusing now
@SMA5HPL
@SMA5HPL 7 жыл бұрын
are you going to make Flask tutorials ? :V
@nabilanaz4830
@nabilanaz4830 4 жыл бұрын
url(r'^$',views.homepage), url(r'^$',views.about), When I run the above,the content of view.homepage gets displayed. Why doesn't the content of views.about gets displayed instead?Since that line of code got executed in the end?
@syntaxis5584
@syntaxis5584 4 жыл бұрын
I know this is old but with Django it will display the first view it finds that matches the URL
@syntaxis5584
@syntaxis5584 4 жыл бұрын
I should add this video is out of date and using Django 1.11. Django is currently in version 3.0 3.0 doesn't use regex so simply path("", ,views.homepage) is the way to do it
@peymannaji
@peymannaji 7 жыл бұрын
Why do we need request parameter for the functions in the views.py ?
@user-mfsc-2024
@user-mfsc-2024 7 жыл бұрын
without using regx, is url('admin/', admin.site.urls) working?
@raymondmichael4987
@raymondmichael4987 6 жыл бұрын
Hello Ninja master, will this wagon receive rewriting (as react wagon) to reflect django version 2.x, as few things have changed.. If not we'll have jump on the docs, I guess Just asking,
@NetNinja
@NetNinja 6 жыл бұрын
Hey, yeah, at some point I'll be doing a re-run of the whole series using Django 2.x - whatever is current at the time. I've got a few other playlists to do first though!
@raymondmichael4987
@raymondmichael4987 6 жыл бұрын
@@NetNinja, I can live with it.
@sjsks2
@sjsks2 5 жыл бұрын
such a great work !!
@unicorn-space1934
@unicorn-space1934 5 жыл бұрын
Thank you..it's help me to my project ..once again thank you
@prasadkadu9737
@prasadkadu9737 4 жыл бұрын
some parts have updated in django you might consider updating your videos least about Urls.py
@sostomc
@sostomc 6 жыл бұрын
This is really good! thanks.
@zahraBatenin
@zahraBatenin 7 ай бұрын
it's 2024 and I think things have changed a lil bit. I dont recognize the syntax. am I right?
@NetNinja
@NetNinja 7 ай бұрын
Correct! new Django crash course coming very soon :)
@sntrdm
@sntrdm 7 жыл бұрын
love you
@johnrogers3315
@johnrogers3315 4 жыл бұрын
excellent explanations, thank you. Is there any intention of updating this series to Django 3? Would happily pay for that. Thanks again
@asiimwemuhabuzimuhoozi3422
@asiimwemuhabuzimuhoozi3422 4 жыл бұрын
Thanks for the help
@amaurypicotto7671
@amaurypicotto7671 4 жыл бұрын
Django Version 3.1.1 in urls.py: from django.contrib import admin from django.urls import path from . import views urlpatterns = [ path('admin/', admin.site.urls), path('about/', views.about), path(' ', views.homepage), ]
@theOfsen
@theOfsen 5 жыл бұрын
Hey ! Django in updated to 3.0.1 now so check this if you have problems with the path() docs.djangoproject.com/en/3.0/topics/http/urls/#using-regular-expressions
@Samuel-br8wc
@Samuel-br8wc 7 жыл бұрын
what version are you using django in this playlist?
@NetNinja
@NetNinja 7 жыл бұрын
Hey, it's version 1.11, the one directly before 2 was released. Everything in this series should still work with Django 2. But Django 2 has added a couple of nice features such as using paths instead of urls - meaning we don't need those nasty RegEx anymore :)
@Samuel-br8wc
@Samuel-br8wc 7 жыл бұрын
thank you for create awsome django tutorial. I understand with the difference URLs.
@mohammedsharikuzama5518
@mohammedsharikuzama5518 6 жыл бұрын
I am getting a 404 error saying page not found at /
@fandiks
@fandiks 6 жыл бұрын
Same here, try to remove '^' and '$' symbol. It works here
@Mahmoud-ys1kt
@Mahmoud-ys1kt 11 ай бұрын
Thank you very much, what kind of accent is this, is it British ?
@andresmontoya7852
@andresmontoya7852 7 жыл бұрын
the new form to create urls is this -> docs.djangoproject.com/en/2.0/intro/tutorial01/ here a simple example (this is with django 2) -> from django.contrib import admin from django.urls import path from . import views urlpatterns = [ path('admin/', admin.site.urls), path('about/', views.about), path('', views.homePage), ]
@jenikashah4323
@jenikashah4323 4 жыл бұрын
Is this for windows 10 ?
@pthiago_s5075
@pthiago_s5075 5 жыл бұрын
Damn this video made me wish to get up from the bed and get back to vs code
@lukslda1
@lukslda1 6 жыл бұрын
Thanks you! Take your like! 👍🏼
@michaelkamau9565
@michaelkamau9565 6 жыл бұрын
Thank you so much!!
Django Tutorial #4 - HTML Templates
5:54
Net Ninja
Рет қаралды 140 М.
Learn Django in 20 Minutes!!
21:25
Tech With Tim
Рет қаралды 449 М.
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Passing Values Through the URL in Django
14:16
Pretty Printed
Рет қаралды 86 М.
Django Tutorial #5 - Django Apps
15:20
Net Ninja
Рет қаралды 107 М.
Django Models.py - Django Databases #2
20:50
Codemy.com
Рет қаралды 55 М.
Django Apps, Views and Templates (A Beginners look)
17:18
CodingWithMitch
Рет қаралды 63 М.
Django and htmx Tutorial: Easier Web Development
1:05:52
PyCharm, a JetBrains IDE
Рет қаралды 27 М.
Python Django Pages, URLs & Slugs
20:55
Dave Gray
Рет қаралды 10 М.