media_root以及static_root配置

# At the top of settings/base.py
from os.path import join, abspath, dirname
here = lambda *x: join(abspath(dirname(__file__)), *x)
PROJECT_ROOT = here("..", "..")
root = lambda *x: join(abspath(PROJECT_ROOT), *x)
# Configuring MEDIA_ROOT
MEDIA_ROOT = root("media")
# Configuring STATIC_ROOT
.
STATIC_ROOT = root("collected_static")
# Additional locations of static files
STATICFILES_DIRS = (
root("assets"),
)
# Configuring TEMPLATE_DIRS
TEMPLATE_DIRS = (
root("templates"),
)

上一篇:Winserver2008R2 .netframework4.5 asp.netmvc 访问出现的是文件列表。


下一篇:eclipse、 IDEA中字母大小写转换快捷键