ubuntu dajngo部署静态文件
1. 在django项目根目录下创建/collectedstatic/文件夹## 2. 配置apache2配置, 我的配置如下## <VirtualHost *:80> ServerName mysite Alias /static/ /home/ivan/workspace/mysite/myWebSite/collectedstatic/ WSGIScriptAlias / /home/ivan/workspace/mysite/myWebSite/myWebSite/wsgi.py <Directory /home/ivan/workspace/mysite/myWebSite/collectedstatic/> Order deny,allow Allow from all Options -Indexes FollowSymLinks </Directory> </VirtualHost> 3.在django setting下配置STATIC_ROOT项,使其指向/collectedstatic文件夹## 我的部分setting配置 STATIC_URL = '/static/' SITE_ROOT = os.path.dirname(os.path.abspath(__file__)) SITE_ROOT = os.path.dirname(os.path.join