Professional Documents
Culture Documents
Lecture 07
Lecture 07
Lecture 07
<!DOCTYPE html>
<html lang="en">
<head>
<title>Student Info</title>
<meta content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="">
<script src=""></script>
</head>
<body>
{% block content %}
{% endblock content %}
</body>
</html>
H. U. Yakubu - CS Department, BUK. (Lecture 7) 10
Home Page (Updated)
Edit the content of the home page to this:
{% extends ‘base.html’ %}
{% block content %}
<img src="img_la.jpg" alt="LA" style="width:100%">
<div class="">
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</div>
{% endblock content %}
H. U. Yakubu - CS Department, BUK. (Lecture 7) 11
Courses Page (Updated)
Edit the content of the courses page to this:
{% extends ‘base.html’ %}
{% block content %}
<div class="">
<h1>Our Courses</h1>
<p>1. ITC3340</p>
<p>2. CSC3330</p>
</div>
{% endblock content %}
{% extends ‘base.html’ %}
{% block content %}
<div class="">
<h1>Our Students</h1>
<p>Software Engineering 150 students</p>
<p>Computer Science 200 students</p>
</div>
{% endblock content %}
o Multi-line comment:
{% comment %}
This line, and
this line won’t be rendered.
They are all commented.
{% endcomment %}
H. U. Yakubu - CS Department, BUK. (Lecture 7) 18
If
Some Tags require beginning and ending tags:
{% if male %}Dear Mr. {{ user.last_name }},
{% else %}
Dear Mrs.
{% endif %}
{% url ‘name_of_a_path’ %}
Example
<a href = “{% url ‘name_of_a_path’
%}”>Students</a>
Def all_courses(request):
allcourses = Course.object.all()
context = {‘allcourses’: allcourses}
return render(request, ‘all-courses.html’, context)