更新到Django 1.10后,我遇到静态文件图像问题。现在Django添加到静态文件路径" media"链接...例如之前它是" /static/images/avatar.jpeg"现在" / 媒体 /static/images/avatar.jpeg"
设置
STATIC_URL = '/static/'
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(BASE_DIR, 'static'),
'static',
)
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
MEDIA_URL = '/media/'