장고 1.10 + uWsgi + nginx를 사용하고 있습니다.Django - 정적/CACHE 파일을 찾을 수 없습니다.
404 ... static/CACHE/js/e3a6fa7588d1.js" failed (2: No such file or directory),
폴더 static/CACHE
는 (그래서 404의 메이크업 감각) 비어, 그런데 왜 : 정적 파일이 표시되지 않습니다 생산성 모드에서 이 내의 nginx 오류 로그가 나에게 말한다 무엇인가? static/CACHE
에 대한 사용 권한을 이미 775
(으)로 설정했습니다.
의 nginx의 conf :
# /etc/nginx/sites/available/mysite_nginx.conf
# the upstream component nginx needs to connect to
upstream bdjango {
server unix:///tmp/mysite.sock; # for a file socket
}
# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name dev.mysite.com; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 8M; # adjust to taste
# Django media
location /media {
alias /var/www/mysite/src/media; # your Django project's media files - amend as required
}
location /static {
alias /var/www/mysite/src/static; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the Django server.
location/{
uwsgi_pass adjango;
include /var/www/mysite/src/uwsgi_params; # the uwsgi_params file you installed
}
}
장고 설정은 그래서
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__) + "../../../")
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
를 포함, 왜 내 JS/CSS를
static/CACHE
에없는 파일입니까?
는 편집 : 는 그것을 해결 : uwsgi_pass는 (다른 웹 사이트를 우연히) 잘못된 상류 위치에서 가리키고 : uwsgi_pass adjango;
이미 있습니다. 파일은'/ static'에 복사되지만,'static/CACHE' 파일은 비어 있습니다. – FeedTheWeb
'장고 압축기'입니까? – user73657
예. 하지만 파일을 만드는 것 같지 않습니다. – FeedTheWeb