Django 1.10将媒体网址添加到静态图像文件中

时间:2016-11-10 11:01:16

标签: django django-staticfiles

更新到Django 1.10后,我遇到静态文件图像问题。现在Django添加到静态文件路径" media"链接...例如之前它是" /static/images/avatar.jpeg"现在" / 媒体 /static/images/avatar.jpeg"

管理员enter image description here

设置

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/'

0 个答案:

没有答案