Django

How to Create a Video Uploader with Django in Admin panel

Pinterest LinkedIn Tumblr

How to Create a Video Uploader with Django in Admin panel

open models.py

from django.db import models
 
# Create your models here.
 
 
class Videos(models.Model):
    title = models.CharField(max_length=100)
    video = models.FileField(upload_to='videos/')
     
    class Meta:
        verbose_name = 'video'
        verbose_name_plural = 'videos'
         
    def __str__(self):
        return self.title
     

Run Migrate Command

python manage.py makemigrations
 
python manage.py migrate