jeudi 24 septembre 2020

Django Video File

I have a problem when I try to display a video in a post. It won't display it

HTML FILE

               

Models.py

class Post(models.Model):
    title = models.CharField(max_length = 100)
    content = models.TextField()
    date_posted = models.DateTimeField(default = timezone.now )
    #one user can have multiple posts, but one post can only have one author
    author = models.ForeignKey(User, on_delete = models.CASCADE)
    image = models.ImageField(blank = True, null=True, upload_to='post-images')
    video = models.FileField(blank=True, null=True, upload_to='post-images')

    def __str__(self):
        return self.title

    def get_absolute_url(self):
        return reverse('blog-home')

how can I solve this




Aucun commentaire:

Enregistrer un commentaire