我正在轉向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 2013-11-03 14:39:02