You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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)
# location = models.CharField(max_length=30, blank=True)
birth_date = models.DateField(null=True, blank=True)
image = models.ImageField(upload_to='profile_pics/', default='img_avatar.png')
`
views.py
def handle_save(request):
if request.method == 'POST':
profile_pic = request.FILES['new-profile-img']
print(profile_pic)
The text was updated successfully, but these errors were encountered: