Olá, Estou tentando exibir um texto apartir do banco de dados em mysql, utilizando Django, já procurei por vários tutoriais mas nada funciona, se alguém puder ajudar agradeço desde já.
Este é parte do meu arquivo: index.html
<div class="col-lg-4 col-6">
<div class="small-box bg-warning">
<div class="inner">
{% for rf in indrf %}
<h3>{{rf.id}}</h3>
{% endfor %}
<p>Indicações registradas</p>
</div>
Este é meu aquivo de modelo: models.py
from django.db import models
class indications(models.Model):
name = models.CharField(max_length=50)
phone = models.CharField(max_length=15)
obs = models.TextField()
status = models.CharField(max_length=10)
user_id = models.CharField(max_length=50)
Este é parte do aquivo view: views.py
def countrefused(request):
indrf = indications.objects.all()
return render(request,"index.html",{'indrf':indrf})
Porem toda vez que executo, o código não me retorna nada. Grato!!