I am trying to upload an image following the documentation but getting the error : This backend doesn't support absolute paths.
here is my code.
models.py
`from django.db import models
from django.contrib.auth.models import User
from multiselectfield import MultiSelectField
Create your models here.
class profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
CLASS_CHOICES = [
('Class - IX', 'Class - IX'),
('Class X', 'Class X'),
]
standard = models.CharField(choices=CLASS_CHOICES, default='Class X', max_length=10)
roll_number = models.SmallIntegerField(blank=True,primary_key=True)
bio = models.TextField(max_length=500, blank=True)
I am trying to upload an image following the documentation but getting the error : This backend doesn't support absolute paths. here is my code. models.py `from django.db import models
from django.contrib.auth.models import User from multiselectfield import MultiSelectField
Create your models here.
class profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) CLASS_CHOICES = [ ('Class - IX', 'Class - IX'), ('Class X', 'Class X'), ] standard = models.CharField(choices=CLASS_CHOICES, default='Class X', max_length=10) roll_number = models.SmallIntegerField(blank=True,primary_key=True)
bio = models.TextField(max_length=500, blank=True)
` views.py def handle_save(request): if request.method == 'POST': profile_pic = request.FILES['new-profile-img'] print(profile_pic)