У нас вы можете посмотреть бесплатно Render Template In Django Part4 Django Tutorials или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Link:https://tutorialwithproject.com/rende... Join : / jagwithyou / jagwithyou https://github.com/jagwithyou In the last part, we have created a hello world application, and there we have returned a simple h2 tag to the request. but in the real world there will be lots of lines present so it's not the right way to write all the HTML code inside the view so we can use render method to render the HTML page. Updating views to render the template For rendering a template we are going to use render method it is automatically imported while creating the app so we don't have to import that if it's not been imported then import it first and then, use it with the return statement like below. django_basics/hello_world/views.py from django.shortcuts import render from django.http import HttpResponse def home(request): return render(request, "hello_world.html") This render function takes the request as the first argument and the HTML page path from the template folder in the second argument. Now we will create the template(i.e the HTML page what the render function is rendering for. In Django, every template should be present inside the templates folder and the render function will search for the template from there. First, create a templates folder inside the hello_world app and create your template there(in our case hello_world.html). django_basics/hello_world/templates/hello_world.html NOTE: You can access your hello world page on "/hello_world". In localhost:8000/hello_world Complete Playlist: https://tutorialwithproject.com/what-... https://tutorialwithproject.com/creat... https://tutorialwithproject.com/hello... https://tutorialwithproject.com/rende... https://tutorialwithproject.com/stati... https://tutorialwithproject.com/creat... https://tutorialwithproject.com/add-a... https://tutorialwithproject.com/templ... https://tutorialwithproject.com/addin... https://tutorialwithproject.com/link-... Thank You Keep Learning & Keep Growing #TWP #DjangoTutorials #LearnOnLockdown