How do I store the uploaded file inside a folder having the name from the model field in django?
问题 Using the upload_to argument of FileField I want to store the file uploaded by the user in a folder named TestName ie the test name entered by the user. I've written the following code, but it creates a folder named "models.CharField(max_length=255)" instead. How can I fix this? from django.core.validators import FileExtensionValidator from django.db import models from django.contrib.auth.models import User class TestInfo(models.Model): TestName = models.CharField(max_length=255) MaxMarks =