Answer the question
In order to leave comments, you need to log in
How to change upload_to in django model?
there is this model:
class File(models.Model):
owner = models.ForeignKey(CustomUser, on_delete=models.CASCADE)
file = models.FileField(upload_to='/files/')
file_name = models.TextField(blank=False)
file_full_name = models.TextField(blank=False, unique=True)
file_extension = models.TextField(blank=False)
date_of_creation = models.DateTimeField(auto_now_add=True)
имя_пользователя/files/
owner
get the username
user from the field when creating? Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question