码迷,mamicode.com
首页 > 其他好文 > 详细

media_root以及static_root配置

时间:2014-08-26 22:51:26      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:os   io   sp   on   ad   c   file   as   rom   

# 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"),
)

media_root以及static_root配置

标签:os   io   sp   on   ad   c   file   as   rom   

原文地址:http://www.cnblogs.com/tuifeideyouran/p/3938227.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!