Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
This can be solved, for example, by writing your own FileStorage
https://docs.djangoproject.com/en/dev/topics/files/
Something like this:
import os
from django.conf import settings
from django.db import models
from django.core.files.storage import FileSystemStorage
my_storage = FileSystemStorage(location=os.path.join(settings.BASE_DIR, 'image'))
class My_model(models.Model):
file1 = models.FileField() # дефолтный MEDIA_ROOT
image = models.FileField(storage=my_storage) # пользовательский путь хранения
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question