django html1 Django, 탬플릿 태그를 활용하여 DB에 등록된 데이터 출력 및 페이징네이션 0. 개요 DB에 데이터를 저장하는 부분은 생략합니다. models.py from django.db import models from django.contrib.auth.models import User # Create your models here. class Question(models.Model): author = models.ForeignKey(User, on_delete=models.CASCADE) subject = models.CharField(max_length = 200) content = models.TextField() create_date = models.DateTimeField() def __str__(self): return f'{self.subject}' 1. view.py fr.. 2024. 4. 7. 이전 1 다음