5 Django tutorials Django Template Language DTL
>> YOUR LINK HERE: ___ http://youtube.com/watch?v=GNlIe5zvBeQ
Check out our courses: • Java Full Stack and Spring AI - https://go.telusko.com/JavaSpringAI • Coupon: TELUSKO10 (10% Discount) • DevOps with AWS: From Basics to Mastery : https://go.telusko.com/DevOpsAWS • Coupon: TELUSKO10 (10% Discount) • Master Java Spring Development : https://go.telusko.com/masterjava • Coupon: TELUSKO20 (20% Discount) • Udemy Courses: • Spring: https://go.telusko.com/udemyteluskosp... • Java:- https://go.telusko.com/udemyteluskojava • Java Spring:- https://go.telusko.com/Udemyjavaspring • Java For Programmers:- https://go.telusko.com/javaProgrammers • Python : https://go.telusko.com/udemyteluskopy... • Git : https://go.telusko.com/udemyteluskogit • Docker : https://go.telusko.com/udemyteluskodo... • For More Queries WhatsApp or Call on : +919008963671 • website : https://courses.telusko.com/ • In this lecture we are discussing about: • #1 DTL (Django Template Language) • a) use of DTL in Django • b) use dynamic content in Django • #2 use of Jinja template example in Django. • -- in views.py you can use html tag inside HttpResponse • def home(request): • -- it work fine to use tag inside HttpResponse • -- but if you want a big page then you need to create a template • -- and this has a dynamic page • #1 DTL (Django Template Language) • we have concept of DTL (Django Template Language) • -- other option in django is jinja template • --generally you created the app outside the app • -- and then you can use it in your project • -- you can create a folder with name templates outside the app folder • Now in templates folder you can create a html file • -- home.html • Now you go to telusko folder inside change the settings.py • -- in templates • -- in DIRS change the path [os.path.join(BASE_DIR,'templates')], • -- now you can use the template in your views.py • a) Now you need to change the views.py • -- from django.shortcuts import render • -- from django.http import HttpResponse • -- def home(request): • -- return render(request,'home.html') • b) now you get dynamic content • -- now you want to pass some dynamic value from views.py • inside this home function add JSON data • -- def home(request): • -- return render(request,'home.html'{'name','Navin'}) • -- go to templates and next to home.html • -- changing content in json file will change the content in html file • #2 use of Jinja template example in Django. • -- this curly braces {{name}} simply means jinja templates or pattern • -- we can do operation in jinja templates • -- you can use jinja templates instead of DTL • -- but DTL is by default in django • • Python Tutorials for beginner : https://bit.ly/2qfhUCp • Django Tutorials : • #1 Django tutorials | What is Django?... • • Django is a high-level Python-based free and open-source web framework, which follows the model-view-template (MVT) architectural pattern. • It is maintained by the Django Software Foundation (DSF). • Django's primary goal is to ease the creation of complex, database-driven websites. • Some well-known sites that use Django include the Public Broadcasting Service, Instagram, Mozilla, The Washington Times, Disqus, Bitbucket, and Nextdoor. • In this video we will see: • Django Tempalte Language • Including HTML tags in a program • Create Django Template to create dynamic webpage • Editing settings.py file • Github :- https://github.com/navinreddy20/Python- • • Editing Machines Monitors : • https://amzn.to/2HA6ra8 • https://amzn.to/2VMBBPw • https://amzn.to/2RfKWgL • https://amzn.to/2Q665JW • https://amzn.to/2OUP21a. • • Instagram : / navinreddy20 • Twitter : / navinreddy20 • Telusko : / teluskolearn. . • Navin Reddy : / navintelusko • Subscribe to our other channel: • Navin Reddy : / @navinreddy • Telusko Hindi : / @teluskohindi • Donation Support: • Indian Payment : https://www.instamojo.com/@NavinReddy/ • PayPal Id : navinreddy20 • Patreon : navinreddy20
#############################
