Django多租户模式媒体文件路径

Django多租户模式媒体文件路径,django,Django,我将Django与多租户模式一起使用。在制作上一切都很好,但我对图像媒体路径有一个问题 我的web服务器是安装在Ubuntu 18.04上的Apache2,在我的站点配置文件中: ''' 我的问题是,有一种方法可以在/var/www/qibot_system/media/xxxxxxxx的末尾设置变量,以提供到django的正确路径 致意 ServerName qibot.com.br ServerAlias tenant1.qibot.com.br tenant2.qibot.com.br

我将Django与多租户模式一起使用。在制作上一切都很好,但我对图像媒体路径有一个问题

我的web服务器是安装在Ubuntu 18.04上的Apache2,在我的站点配置文件中:

'''

我的问题是,有一种方法可以在/var/www/qibot_system/media/xxxxxxxx的末尾设置变量,以提供到django的正确路径

致意

ServerName qibot.com.br
ServerAlias tenant1.qibot.com.br tenant2.qibot.com.br tenant3.qibot.com.br
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

Alias /static /var/www/qibot_system/static
<Directory /var/www/qibot_system/static>
Require all granted
</Directory>

Alias /media /var/www/qibot_system/media/
<Directory /var/www/qibot_system/media/>
Require all granted
</Directory>
...

</VirtualHost>
/var/www/qibot_system/media/ instead of 
/var/www/qibot_system/media/tenant1 or 
/var/www/qibot_system/media/tenant2 or 
/var/www/qibot_system/media/tenant3