Django Tutorial #5 - Django Apps

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

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

  • @sandunnirmala9269
    @sandunnirmala9269 6 лет назад +49

    Hey ninja you are some awesome man. I tried to learn codinf of django by others videos. But all are just throwing out words. But you are teaching what are the meanings of them and what is the meaning of this thing, this thing, etc. So it is so much easy to understand with its meaningfull way. you are the best teacher i have ever found. and you know i don't even follow any computer science degree but i followed your videos. Thank you ninja, You are savior

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

    Probably the best explanation how everything thing is wired up. Thanks for taking the time to explain Projects/Apps, and difference emphasizing that url routes to view, -> templates. I think most other tutorials don't go into details step by step how everything ties in together. This was a very well laid out explanation using very simple concepts.

  • @maishacodes
    @maishacodes 5 лет назад +17

    This is the best Django series ever! I am successfully being able to do everything perfectly.

  • @yyjones79
    @yyjones79 6 месяцев назад +1

    6 years old, but still very useful.
    Thanks for these tutorials.
    With a bit of GPT help, and I'm able to do some interesting stuff.

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

    For those who using Django 2.0, the url is replaced by path so just typed this in the root urls.py: path('articles/', include('articles.urls')),
    And for the urls.py in the articles app, can typed in different name like path('articles_home/', views.article_list),
    Finally, when call the route in the browser, just call 127.0.0.1:8000/articles/articles_home
    Will solve the problem that the page keep returns NOT FOUND 404 error.
    PS: If fully following the video on naming then can just call 127.0.0.1:8000/articles/articles
    Its just seems weird route to me~
    And thanks ninja for the hard work and awesome tutorials! I've learn a lot from you! :D

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

    I was stuck on this for a while...wouldn't have tried again if it wasn't for you....thanks man

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

    Paid for a Django course on Udemy and yet this is so much more intuitive! Thanks!

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

      Udemy Django courses are outdated

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

      @@shreehari2589 this one too but also good

  • @9keen
    @9keen 4 года назад +4

    Thx dude! was being stucked with the urls, settings, views concepts for few days by someone else videos... and hence you solved all those puzzle in 15mins! Thank you!

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

    Even though these tutorials are 3 years old, i came here to learn django from you, so many thanks and i wish this course gets updated

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

    Bro ur tutorials are far better than many other tech channels

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

    Thank you for explanation. Now I understand what is a project and what is an app within a Django project. Apps are like widgets that do some specific actions and that we can reuse in another project for example.

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

    Love the graphic....you should be proud :) and the tutorials are well explained...thank you

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

    Very kind to offer such great tutorials for free online! thank you very much for your help and your good way of teaching, you are the best

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

      Yes, I also agree on the fact that you are the best programming teacher I have ever had!

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

    Man even 11 year old me will understand what he teach . Really thankful for you man .

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

    Very very clear explanation, thank you

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

    Welcome to the best django series in the entire universe, lol. I've been following since video 1

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

    I'm so bloody glad I found this tutorial series.

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

    Thanks bro, you are best teacher

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

    Amazing tutorial. So clear. Thank you!

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

    Your django series are really awesome. Thank you ninja 🤖🤖🤖

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

      Glad to hear that :) thanks Mabel!

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

    Yow content after content i feel like a better developer already...thanks mate

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

    This is a great tutorial, but I just wish there was a snapshot diagram / anatomy showing every piece linked together. Trying to remember all this via the files & code is not necessarily easy for beginners. It's easy to not "see the forest, for the trees". Nevertheless, seems to be the most thorough Django tutorial I've seen.

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

    Thank you kind sir. I was completely lost. Now I am found.

  • @Lily-ed2sc
    @Lily-ed2sc 3 года назад

    Hey this is great man. You saved my life

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

    Oh man you are awesome
    I have been coding in past
    But i had no idea what i am doing that’s why have used to face lot of problems
    But your way of teaching django has cleared my confusions and made this look so beautiful
    Thanks a ton
    Keep up the good work.
    Can you help me get a freelance work for this?
    That Would be great

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

    Awesome explanation

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

    for anyone receiving the template not found error, go into your settings and paste the entire path related to the article templates folder in the DIR list to fix the error.
    example: 'DIRS': ["templates",r"C:\Users\your name\Documents\Web Applications\To-Do\djangonautic\articles\templates"]

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

    Wow, I am so impressed by your videos! Thank you so much!!

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

    Hi - excellent video series. I don't know how you have done it but the resolution is great. Other atom-based videos are generally poor although they are put out in 1080. Thanks again.

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

    For all u r videos, u r awesome, great and no words to explain!!!!

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

      Thank you so much 😀

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

      @@NetNinja Could you please create a video of Get and Post function and also retrieving data from Mongodb database. It is will be very useful!!!

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

    Enjoying these videos - wondering when the other videos will be released!!

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

    This is the best tutorial. Belive it!

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

    Hats off to you man! your videos are helping alot.

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

    Thanks, That is really awesome

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

    There is no "settings.py" file in our current "articles" app, how does Django know that it needs to go to TEMPLATES folder first, to open "articles/article_list.html" file, if we specify just "return render(request,'articles/article_list.html')"?

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

      This is how I imagine django knows where to look:
      1)
      ------
      The main project is the outer layer and the main urls.py serves as a window through which django gains access to the inner mini apps. When django checks the main urls.py, it sees this:
      url(r'^articles/', include('articlesApp.urls')),
      the "include" keyword tells django to go somewhere else directs django to look for the mini app (articles) and more specifically; the urls.py of that mini app (we created that file ourselves. it's not created automatically when you start a new app)
      2)
      ----
      Now that we are in the urls.py of the mini app (articles), django sees this:
      urlpatterns = [
      url(r'^$', views.artciles_list)
      ]
      and thus acknowledges there is a mapping between the (home route of the mini app) and a function called "article_list" that exists "as you already know" in the views.py file of the mini app.
      3)
      ----
      and finally as you can see here,
      def artciles_list(request):
      return render(request, "articles/articles.html")
      the second parameter makes sure django is looking at the right place. ""articles/articles.html""

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

      I have same question even i tried the same steps but django still looking into main app.
      i am getting below error while accessing the page.
      Request Method: GET
      Request URL: 127.0.0.1:8000/articles/
      Django Version: 2.1.4
      Exception Type: TemplateDoesNotExist
      Exception Value:
      articles/article_list.html
      Exception Location: C:\Users
      ikumar\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\template\loader.py in get_template, line 19
      Python Executable: C:\Users
      ikumar\AppData\Local\Programs\Python\Python37-32\python.exe
      Python Version: 3.7.1
      Python Path:
      ['C:\\Users\
      ikumar\\DjangoProject\\djangonautic',
      'C:\\Users\
      ikumar\\AppData\\Local\\Programs\\Python\\Python37-32\\python37.zip',
      'C:\\Users\
      ikumar\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
      'C:\\Users\
      ikumar\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
      'C:\\Users\
      ikumar\\AppData\\Local\\Programs\\Python\\Python37-32',
      'C:\\Users\
      ikumar\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages']
      Server time: Wed, 19 Dec 2018 05:01:21 +0000
      ------------------------------
      Django tried loading these templates, in this order:
      Using engine django:
      django.template.loaders.filesystem.Loader: C:\Users
      ikumar\DjangoProject\djangonautic\Template\articles\article_list.html (Source does not exist)
      django.template.loaders.app_directories.Loader: C:\Users
      ikumar\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\contrib\admin\templates\articles\article_list.html (Source does not exist)
      django.template.loaders.app_directories.Loader: C:\Users
      ikumar\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\contrib\auth\templates\articles\article_list.html (Source does not exist)

    • @vedprakash-bw2ms
      @vedprakash-bw2ms 5 лет назад

      Initially it was not working .
      I tried changing imports
      From django.urls import include
      But still it didn't work and then i get back to old import for include.
      It some worked after that I didn't get what happened there.

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

    Nice Tut !
    Which fonts are you using?

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

    You are an awesome Ninja!!...Thank you!!

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

    Are Django apps similar to how Microservices work? In the way that there is a different application for each function of the app? Can these Django apps be split to run on different machines?

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

    The Ninja Strikes again. Hope you can make a real life project Django tutorial up to Deployment and I will buy it. Thanks

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

    hey thanks man it worked

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

    PLEASE HELP:
    File "E:\Z\Django\myproject\myproject\urls.py", line 10, in
    path(r'articles/',include(articles.urls)),
    NameError: name 'articles' is not defined
    Ive searched for a solution everywhere

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

      @Alex Rohan thank you , it helped me also.

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

    Awesome like always keep it up bro. one question please, what framework would you recommend on building a simple like CMS with an admin panel that can manage databases/tables? cheers, by the way to you have more in depth courses anywhere? thanks

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

    Is there a way to link two apps together? So i have two apps which have two different product models. One of them is linked to the bag/checkout. But when i try to add the other app to add items to the bag it doesn't work. Please let me know if theres a way or guide to conmecting two apps to checkout bag

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

    Tell the difference between / and \ usage whilr wrting the address.
    Where to use them .
    Pls.

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

    great video mate

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

    please help me to tackle this problem currently i'm using django 2.0 version , i'm have followed same step as mention in the video, but still it arising this issue TemplateDoesNotExist, By the way ur videos are awesome

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

      Your templates folder isn't in a correct location, it should be right next to manage.py (for the homepage and about pages)

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

    thanks a lot

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

    Yelp! I am getting an error when I spin up the server using "python manage.py runserver" cmd. I get this error:
    django.core.exceptions.ImproperlyConfigured: WSGI application 'djangonautic.wsgi.application' could not be loaded; Error importing module.
    what could be causing this? I've been following the tute closely and haven't touched the wsgi file

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

    sir please help when i write this "obj = test.objects.all() " then error is "Class 'test' has no 'objects' member" sir what i do.

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

    You should include a link to all chapters

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

    man you are God

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

    Hey shun, i love the way u teach, and i stuck in rendering
    return render(request, 'articles/article_list.html'),
    Its giving me
    "template doesn't exist"
    When use like this ex :I've removed articles folder which is in app level templates folder and I refer like this
    return render(request, 'article_list.html'),
    It works well
    but as u said, if both templates have same name at
    "project level template and app level template",
    then priority will go to project level template so to avoid this we've create name space just I've done but it unable to find this name space
    ex: return render(request, 'articles/article_list.html'),
    *if we read this plz gimme answer*
    *I'm using vs code*

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

      Try to Add the 'templates' name in the Settings.py file DIRS:[ ]

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

      @@varunarya2126*hey tq bro but I've already added template folder name to the root directory, and I've uninstalled the project and created a new one and surprisingly it was workes and rx for ur suggestion varun*

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

      @@kvnagendra5354 i'm getting same error, can you help me out? did u find any solution?

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

    which version of django are you using

  • @tariq.mehmood
    @tariq.mehmood 4 года назад

    YOU ARE THE BEST!!

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

    Sir what is the theme you are using in atom?...It looks nice..

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

      Hey, the syntax theme is Atom Monokai, and the UI theme is One Dark. I also use a package called 'Seti Icons' for all the little icons in he file tree on the left :)

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

      The Net Ninja
      Thnks for taking the time to reply out of your hectic schedule

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

    Great stuff

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

    Can you make a tutorial with bookshelf.js

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

    Is it ok that we dont create project on virtual environment

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

      I believe best practices are to create your project on virtual environment to avoid overwriting django root files

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

    how to solve this error ? AttributeError: module 'articles.views' has no attribute 'articles_list'

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

    Not sure if anyone is still looking at these comments, but have been following this tutorial as closely as possible but have hit a snag with including the articles.urls module to the views.py file of the main project folder. I seem to be getting this error returned:
    File "C:\Users\HP\Desktop\Projects\web_app\website\articles\urls.py", line 6, in
    url(r'^about/$', views.about),
    AttributeError: module 'articles.views' has no attribute 'about'
    Can't seem to figure out why this keeps occurring. Can anyone help?

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

      Found the answer:
      Include an "about" view within articles view.py file.

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

    How Django knows that "djangonautic" is a main app, and not the "articles" app is a main one?

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

      because we use django-admin startproject djangonautic at first. For articles we use python manage.py startapp articles. Here djangonautic is the actual project where articles is just an app inside the project

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

    I am having this issue, If i change the name of templates folder into other in one of my other project doesn't work, but if i use the name 'templates'. It works. Is there any particular reason to use that name only.

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

      Django search for whatever name u added at django's settings. That "DIRS" list

  • @PaisleeMora-ix1yv
    @PaisleeMora-ix1yv 4 месяца назад

    thanks

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

      Thanks for watching!

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

    hello The Net Ninja
    i am getting this error:
    Using the URLconf defined in huewood.urls, Django tried these URL patterns, in this order:
    admin/
    articles/ articles/
    about/
    The current path, articles/, didn't match any of these.
    it seems that there is a space in between articles/ articles but i am sure i typed it within spaces.
    hellpppp. :(

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

      try removing ^ sign from the url(r'^articles/',include('articles.urls'))

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

    hello the net ninja and thanks again :-o)

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

    Please make an app with Angular and python

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

    How to create realtime chatting system like socket.io using Django?

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

    thx

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

    thaaaaanks

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

    url is no longer working. Its path now.

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

    Django 2.0.1 , include articles in main urlpatterns is not working ( using path not url ) like path('articles/', include('articles.url')). can someone pls assist

    • @s.champloo2801
      @s.champloo2801 6 лет назад

      You have to import include before use it.
      from django.urls import path, include

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

      replace it with path('articles/', include('articles.urls'))

  • @AdelAdel-pn1bq
    @AdelAdel-pn1bq 3 года назад

    1:19 you should be proud

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

    The best!!!

  • @DuongTran-zh6td
    @DuongTran-zh6td 2 года назад

    tạo folder templates trong app mới và tạo thêm folder con trong folder templates đựt tên theo app mới --> tao file htm
    code view để vào file html

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

    it shows me TemplateDoesNotExist at /articles/article_list.html

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

      OK i fix it by changing template to templates -_-

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

      can you help i am not able to resolve even after this as well

    • @o-t3016
      @o-t3016 4 года назад

      @@MrBreslet at settings .py at Templates DIRS = ['djangonautic/templates' , 'articles/templates']

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

    I did exactly that and I didn't get the same results , it keeeps saying that my does not exist

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

      u probably messed up keep on trying watch again carefully it happens all the time

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

      I just changed path to url, or rather I typed everything I saw in this tutorial, and it worked, so remove paths and import url using whatever he did in this tutorial

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

      it can do path way also. i get results. the wrong i did before i didnt put .html for view render my_list file

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

      You ever find the solution I am going through these and have this issue right now.

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

    U are great

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

    python manage.py runserver

  • @user-xn4yu5rn9q
    @user-xn4yu5rn9q 5 лет назад

    Ok

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

    "[WinError 123] The filename, directory name, or volume label " could you please help me this error
    python version - 3.7.0

    • @Luna-cq9ic
      @Luna-cq9ic 5 лет назад +1

      Can you specify PLEASE?!? NO ONE can help you if you only provide this level of information. No wonder no one replied to you comment....

  • @DuongTran-zh6td
    @DuongTran-zh6td 2 года назад

    Tao app moi

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

    please help I am getting this error:
    django.template.exceptions.TemplateDoesNotExist: articles/article_list.html

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

      templates folder should be right next to manage.py (for the homepage and about pages).

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

      @@sakshibhalothia8770 what about articles one?