장고 1.3으로 옮겨 가면서 미디어와 정적 파일의 분리가 다소 혼란 스럽습니다. 여기에 기본 settings.py
이 같은 모습입니다 :Django의 정적 파일과 미디어 파일의 차이점은 무엇입니까?
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''
# Absolute path to the directory that holds static files.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''
# URL that handles the static files served from STATIC_ROOT.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
나는 MEDIA_ROOT
과 STATIC_ROOT
에 무엇을해야합니까? 그것들은 별도의 디렉토리 여야 하는가? 그 차이점은 무엇입니까?
이 게시물을 참조하십시오. https://groups.google.com/forum/#!topic/django-users/tSb4EC0G040 – laike9m