Django Tutorial #3 - URLs and Views

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

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

  • @kbprojekty
    @kbprojekty 5 лет назад +20

    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 месяцев назад +1

      That’s the best way to teach

  • @TaHrPa
    @TaHrPa 2 года назад +12

    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 года назад +3

      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_ 2 года назад +2

      Same here brother

  • @patientson
    @patientson Год назад +4

    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.

  • @temprmj1
    @temprmj1 7 лет назад +69

    Excellent teaching style, not too fast and not dumbed-down either

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

      Thanks so much :). Glad you like.

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

      @@NetNinja ohh yeahh i likeyy

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

      teaching style is best best best...................................

  • @pythonwithpower5664
    @pythonwithpower5664 3 года назад +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!

  • @tunasalad3919
    @tunasalad3919 6 лет назад +2

    you're literally saving somebody's day by doing this. Kudos...I wish everybody should have taught me like this.

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

    Will definitely recommend this to anyone who doesn't understand Django!!! This playlist is a gem

  • @Iwincash
    @Iwincash 3 месяца назад

    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

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

    This has been the best, most clear tutorial on django I've seen yet. Thanks a ton!

  • @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 :)

  • @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!

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

    wow. you make it so much easy to understand. you're completely different from all RUclipsr i know. what a great teacher!

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

      Thanks so much 😊

  • @user-ph2bc8kc6c
    @user-ph2bc8kc6c 5 лет назад +1

    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!

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

    You really know how to walk people through by the hand.
    Thank you for prepering this course.

  • @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! 😃

  • @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.

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

    Love the diagram you showed at the beginning, I'm going to use this too tomorrow in my class!

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

    This is one of the best tutorials on django

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

    Hey man you are giving such valuable material for free 🙂.
    You dropped your 👑

  • @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.

  • @Timbo101001
    @Timbo101001 6 лет назад +2

    This made me understand what I've been trying to understand for ages. Hero.

  • @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

  • @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.

  • @AshishSharma-pm1dc
    @AshishSharma-pm1dc 6 лет назад +2

    Bro you have explained this in such a good manner.Subscribed😁

    • @NetNinja
      @NetNinja  6 лет назад

      Thanks man, glad you liked :)

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

    Am greatful, you made me understand this views and urls syntax in just minutes.👏

  • @seth4402
    @seth4402 6 лет назад +5

    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.

  • @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 :)

  • @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

  • @Дмитрий_Селин
    @Дмитрий_Селин 6 лет назад +1

    к сожалению я английским языком не владею, но просто глядя на схемы, я понял принцип работы Django. Большое спасибо.

  • @MB-qk1bj
    @MB-qk1bj 5 лет назад +1

    Thank you very much for this wonderful tutorial, i was so lost now everything makes perfect sense thank you so much

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

    Nice tutorials dude. No bs directly to point 👍

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

    Excellent explaination..so much simplified

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

    The most clear explanation ,thanks a lot.

  • @etiennelauzier5698
    @etiennelauzier5698 7 лет назад

    You rock !!!!!! Excellent job my friend!!!
    May science bless you.

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

    Thanks so much. Very well explained.

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

    Awesome teaching style

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

    You are awesome Shawn love form India.

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

    I have learned a lot and feel cool, you are good mate!

  • @TheBurningofSolomon
    @TheBurningofSolomon 6 лет назад

    Incredible tutorials, friend. Subscribed mate

  • @dirtymopwater2868
    @dirtymopwater2868 6 лет назад

    This was very clearly explained. Thank you

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

    Hey man, it was a big help, can't thank you enough

  • @mindpower421
    @mindpower421 6 лет назад

    amazing video, one of the best video on this planet

  • @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.

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

    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

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

    Although this video dates back, thanks a bunch!!!👍🏽

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

      Abi, I'm wondering what version of Django is that?

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

    You help me a lot. Thank you for share your knowledge

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

    Excellent, keep up the good work

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

    Great tutorial m8, you helped me a lot! Thank you :D

  • @SMA5HPL
    @SMA5HPL 7 лет назад +2

    are you going to make Flask tutorials ? :V

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

    Thanks for video! What kind of font you use in Atom?

  • @VadimBesedin
    @VadimBesedin 6 лет назад +7

    In newer version of Django, in views.py, instead of:
    return HttpResponse('about')
    use:
    return render(request,'about.html')

  • @user-cc8kb
    @user-cc8kb 4 года назад

    Amazing. Thank you very much! :)

  • @unicorn-space1934
    @unicorn-space1934 5 лет назад

    Thank you..it's help me to my project ..once again thank you

  • @ImtoolVideos
    @ImtoolVideos 7 лет назад +2

    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 лет назад +3

      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

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

    Best series, ngl

  • @sostomc
    @sostomc 6 лет назад

    This is really good! thanks.

  • @sandunnirmala9269
    @sandunnirmala9269 7 лет назад +3

    i am getting this error in cmd. How to solve this sir
    AttributeError: module 'myweb.views' has no attribute 'homepage'

  •  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

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

    Thanks for the help

  • @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

  • @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 :(

  • @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

  • @damniexist51
    @damniexist51 7 лет назад +1

    its
    urlpatterns = [
    path('admin/', admin.site.urls),
    ]
    for me
    whats the difference?

    • @NetNinja
      @NetNinja  7 лет назад +2

      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 лет назад

      :)

  • @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.

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

    I just love how the British pronounce the letter "H". Epic.

  • @sangharshadhital6017
    @sangharshadhital6017 6 лет назад +1

    path(r'^$',home) does not work on my pycharm? it works without using r'^$' symbol... why is it so?

  • @lukslda1
    @lukslda1 6 лет назад

    Thanks you! Take your like! 👍🏼

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

    Damn this video made me wish to get up from the bed and get back to vs code

  • @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 ?

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

    Error I am getting is, when in cmd I type "python manage.py runserver", It does not start the server.

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

      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

  • @michaelkamau9565
    @michaelkamau9565 6 лет назад

    Thank you so much!!

  • @joebegleycodes1347
    @joebegleycodes1347 6 лет назад +1

    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 лет назад +1

      url instead will also work. He changed it between the videos.

  • @sntrdm
    @sntrdm 7 лет назад +11

    love you

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

    some parts have updated in django you might consider updating your videos least about Urls.py

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

    Thanks so much

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

    such a great work !!

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

    Isn't the 'r' to show its a regular expression, what's a raw string?

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

    you are a real G

  • @swatir.567
    @swatir.567 5 лет назад

    THANK YOU OMGGGGGG THQNK YOU SOOO MUCHHH

  • @javierlizarazu7680
    @javierlizarazu7680 6 лет назад

    what version of django are you using? can i follow the tutorial with django 2.0.7 installed?

  • @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?

  • @peymannaji
    @peymannaji 7 лет назад

    Why do we need request parameter for the functions in the views.py ?

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

    What do settings.py and manage.py do?
    Can I get the full code of those files?

  • @Mahmoud-ys1kt
    @Mahmoud-ys1kt 11 месяцев назад

    Thank you very much, what kind of accent is this, is it British ?

  • @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?

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

    Is this for windows 10 ?

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

    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

  • @m.jsoltani8133
    @m.jsoltani8133 4 года назад

    what about venv ?? virtual environment is not necessary in Django?

  • @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 лет назад +1

      @@NetNinja, I can live with it.

  • @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

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

    Does any changes for 2020 version? Or it wil work

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

    wow, thenkz bro.

  • @Samuel-br8wc
    @Samuel-br8wc 7 лет назад

    what version are you using django in this playlist?

    • @NetNinja
      @NetNinja  7 лет назад +3

      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.

  • @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

  • @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 месяцев назад +1

      Correct! new Django crash course coming very soon :)

  • @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),
    ]

  • @user-mfsc-2024
    @user-mfsc-2024 7 лет назад

    without using regx, is url('admin/', admin.site.urls) working?

  • @rameshmathad
    @rameshmathad 6 лет назад

    the runserver gives NameError: name 'path' is not defined along with 100 other lines of errors waht to do please help
    ..../?

  • @aabhasdhaubanja1184
    @aabhasdhaubanja1184 6 лет назад

    Hey why are we using "from . import views" instead of just "import views". I tried it and it doesn't work but why? Aren't they in the same directory? Nice video BTW :)

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

      Strange "import views" works for me but "from . import view" doesn't.

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

      Moon Pig maybe you are missing an 's' in the 'views' in the "from . import views"

  • @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