📜  如何从视图中将图像填充到 django 中的模板 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:20.330000             🧑  作者: Mango

代码示例1
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()

class Image(models.Model):
    owner = models.ForeignKey(User, on_delete=models.CASCADE)
    image = models.ImageField(upload_to='Upload', height_field=None, width_field=None, max_length=100)