mg tut c2
This commit is contained in:
16
backend/app/templates/base.html
Normal file
16
backend/app/templates/base.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
{% if title %}
|
||||
<title>{{ title }} - blog</title>
|
||||
{% else %}
|
||||
<title>Welcome to blog.</title>
|
||||
{% endif %}
|
||||
</head>
|
||||
<body>
|
||||
<div>blgo: <a href="/index">home</a></div>
|
||||
<hr>
|
||||
{% block content %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
11
backend/app/templates/index.html
Normal file
11
backend/app/templates/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Helloo, {{ user.username }}!</h1>
|
||||
{% for post in posts %}
|
||||
<div><p>{{ post.author.username }} says: <b>{{ post.body }}</b></p></div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user