Tôi đang chuyển sang Django 1.3 và tìm cách tách phương tiện và tệp tĩnh này một chút khó hiểu. Sau đây là cách mặc định settings.py
trông giống như:Sự khác biệt giữa các tệp tĩnh và tệp phương tiện trong Django là gì?
# 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/'
tôi nên đặt gì vào MEDIA_ROOT
và STATIC_ROOT
? Có nên là những thư mục riêng biệt không? Sự khác biệt là gì?
xem bài đăng này https://groups.google.com/forum/#!topic/django-users/tSb4EC0G040 – laike9m