在静态折叠中访问图像

2024-04-20 10:46:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我把一些图像放在/static/some\目录下,Django找不到它们。但是当相同的图像放在/static/images中时,Django能够找到它们。我的设置.py具有以下特性:

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/
STATIC_URL = '/static/'

# Added to make "static" directory path relative to BASE_DIR
STATICFILES_DIRS = ( os.path.join(BASE_DIR, "static"), )

我需要添加什么才能使此工作正常?任何帮助都将不胜感激。谢谢。你知道吗


Tags: topathdjangopy图像目录basedir