如何使用django和apache

时间:2018-10-23 07:29:29

标签: django apache

我已经使用apache部署了django应用。我正在使用一个名为django-ads的应用程序,该应用程序允许我上传图像。该应用程序将图像转储到BASE_DIR文件夹中,因此当图像url显示在html页面上时,图像URL为http://ip-address/iphone.jpeg

下面是我的conf文件的外观:

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

WSGIScriptAlias / /var/www/html/mysite/wsgi.py

WSGIDaemonProcess advert-admin python-home=/home/joe/advert-admin/venv 
    python-path=/var/www/html
WSGIProcessGroup advert-admin

<Directory /var/www/html/>
    AllowOverride all
    Require all granted
    Options FollowSymlinks
</Directory>

Alias /static/ /var/www/html/static/

<Directory /var/www/html/static>
    Require all granted
</Directory>

每次加载图像时都会出现404错误。

如何使用Apache为/ var / www / html文件夹中的图像提供服务,以使http://ip-address/iphone.jpeg不返回404?

0 个答案:

没有答案
相关问题