2012-02-04 3 views
1

mod_wsgi을 사용하여 정적 인 plist 파일을 제공하고 싶습니다. 내가 http://localhost/mysite/site_media/mac_config.plist에 갈 때mod_wsgi 및 Django로 정적 파일을 제공하는 방법은 무엇입니까?

Alias /site_media/ "/var/www/mysite/media/" 
<Directory "/var/www/mysite/media"> 
Order allow,deny 
Options Indexes 
Allow from all 
IndexOptions FancyIndexing 
</Directory> 

을 다음과 같이 apache를 구성에서 나는 오류를이 오류가 Django가 요청을 가로 채고 있음을 나에게 말하고있다

Page not found (404) 
Request Method: GET 
Request URL: http://localhost/mysite/site_media/mac_config.plist 
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: 
^config/ 
^admin/doc/ 
^admin/ 
The current URL, site_media/mac_config.plist, didn't match any of these. 

를 얻을. 파이썬을 사용하여 디스크에서 파일을 읽고 http 요청으로 응답하지 않고도이 정적 파일을 어떻게 제공 할 수 있습니까?

+2

http : //localhost/site_media/mac_config.plist – sdolan

+0

@sdolan 시도해보십시오. 프로덕션 서버에이 URL을 넣으려면 url은 www.example.com/site_media/mac_config.plist입니까? – David

+0

예. 별칭은 서버의 루트를 기준으로 폴더에 액세스하는 위치를 정의합니다. – sdolan

답변

1

과 마찬가지로 localhost/site_media/mac_config.plist을 수정하면 문제가 해결됩니다.

관련 문제