blog/views y blog.html
This commit is contained in:
parent
e2f2b0b252
commit
1dcc4909af
@ -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 %}
|
||||
|
@ -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})
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user