2014-10-09 1 views
0

Apache와 mod_wsgi를 사용하여 Django를 설정할 때 tutorial을 따랐지만 (Windows에서는) 정적 파일에 액세스하려고 할 때마다 다음과 같은 오류 :Django/Apache 정적 파일 오류 : 'NoneType'유형의 객체에 len()이 없습니다.

C:\Python27\lib\site-packages\django\core\handlers\base.py in get_response 
TypeError("object of type 'NoneType' has no len()",) 
resolver_match (func=<function serve at 0x0A4FEF70>, args=(), kwargs={'path': u'js/map.js', 'document_root': None}, url_name='django.views.static.serve', app_name='None', namespace='') 

왜 이런 일이 : 유형의 /static/js/map.js 객체에서 형식 오류는 'NoneType'이 DOCUMENT_ROOT 함께 할 수있는 뭔가가 더 LEN()

이 없습니다 , 어디서 'document_root'를 설정해야합니까?

일부 추가 정보를 원하시면 :

Exception Location: C:\Python27\Lib\ntpath.py in splitdrive, line 114 
Python Executable: C:\xampp\apache\bin\httpd.exe 
Python Version: 2.7.8 

C:\Python27\Lib\ntpath.py in join 
result_drive, result_path = splitdrive(path) ... 
▼ Local vars 
Variable Value 
paths  (u'js/map.js',) 
path  None 

답변

0

나는 그냥 나 아파치 구성 (항상 같이) 바보했다, 그것은 장고 오류가 아니었다, 그것을 알아 냈 :

# NOTE: Where filenames are specified, you must use forward slashes 
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache"). 
# If a drive letter is omitted, the drive on which httpd.exe is located 
# will be used by default. It is recommended that you always supply 
# an explicit drive letter in absolute paths to avoid confusion. 

그리고이 같은 별칭이 있었다 : 그것은 봤는데해야

Alias /static/ C:\path\static\ 

Alias /static/ C:/path/static/ 

역 슬래시를 사용하는 WSGIScriptAlias ​​지시문이 작동했기 때문에 이상합니다.

관련 문제