blog/views y blog.html

This commit is contained in:
jp.dev 2020-11-21 04:37:32 -03:00
parent e2f2b0b252
commit 1dcc4909af
2 changed files with 24 additions and 3 deletions

View File

@ -4,6 +4,24 @@
{% block content %}
<div><p>Blog</p></div>
{% for entrada in entradas %}
<!-- Heading -->
<section class="page-section clearfix">
<div class="container">
<div class="intro">
<img class="intro-img img-fluid mb-3 mb-lg-0 rounded" src="{{entrada.imagen.url}}" alt="" style="width: 70%;">
<div class="intro-text left-0 text-center bg-faded p-5 rounded">
<h2 class="section-heading mb-4" >
<span class="section-heading-upper">{{entrada.titulo}}</span>
<span class="section-heading-lower" style="color: Tomato;">{{entrada.contenido}}</span>
</h2>
</div>
</div>
</div>
</section>
{% endfor %}
{% endblock %}

View File

@ -1,6 +1,9 @@
from django.shortcuts import render
from blog.models import Entrada
# Create your views here.
def blog(request):
return render(request, "blog/blog.html")
entradas = Entrada.objects.all()
return render(request, "blog/blog.html", {"entradas":entradas})