I was under the impression that the extends tag and the block title tags would not show themselves in the browser. But they are showing themselves why is this? I know of no other way to show the output of my browser except for showing a screenshot which I believe is discouraged. If there is a better way I would like to know it.
<!-- templates/home.html-->
{% extends "_base.html" %}
{% block title %}Home{% endblock title %}
{% block content %}
<h1>This is our home page.</h1>
{% endblock content %}
How are you rendering this template? (What is the view that is using this template?)
Side note: Showing browser images when it’s needed to show the effect of an issue is appropriate.
We only ask that you don’t post images from the browser when there’s a suitable text representation of the information being supplied.
“Side note: Showing browser images when it’s needed to show the effect of an issue is appropriate.
We only ask that you don’t post images from the browser when there’s a suitable text representation of the information being supplied.”
→ thank you for the clarification on the rule.
I am rendering it with live server in visual studio code to chrome.
# pages/views.py
from django.shortcuts import render
from django.views.generic import TemplateView
# Create your views here.
class HomePageView(TemplateView):
template_name = "home.html"
VSCode Live Server is not running your Django application, so it’s not going to render the template.
You must use runserver (or something like it) to see your rendered page.
Don’t bother trying to use or rely upon Live Server in a Django application.
1 Like
It will not show with live server.
You need to run the development server
1 Like
as always, thank you Ken.