As far as I know, there is no such control, however there is a very simple way to prevent folders from overgrowing: separating files by upload with FileField.upload_to
:
class MeuModelo(models.Model):
meu_campo = models.FileField(upload_to='pasta/%Y/%m/%d')
For example, if you create an instance of this template on 05/14/2015 with the file teste.txt
associated with the meu_campo
field, and its MEDIA_ROOT
is /var/www/uploads
it will be saved in the file:
/var/www/uploads/pasta/2015/05/14/teste.txt
You can vary how you organize your folders by using the same strftime
.
This does not guarantee, of course, that the folders do not grow beyond a predefined size (the user has decided to register more than 800 files the same day ...), nor does it help at all if your application accepts < in> upload files without them being associated with models. If this is a problem for you, all you have to do is make this control by hand.