私はDjango 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