本文整理汇总了Python中unipath.Path.split方法的典型用法代码示例。如果您正苦于以下问题:Python Path.split方法的具体用法?Python Path.split怎么用?Python Path.split使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unipath.Path
的用法示例。
在下文中一共展示了Path.split方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Path
# 需要导入模块: from unipath import Path [as 别名]
# 或者: from unipath.Path import split [as 别名]
#########
# PATHS #
#########
import os
from unipath import Path
PROJECT_ROOT = Path(__file__).absolute().ancestor(2)
#print("PROJECT_ROOT: %s" % PROJECT_ROOT)
PROJECT = str(PROJECT_ROOT.components()[-1])
#print("PROJECT: %s" % PROJECT)
## FIX #19891 (recommends changing BASE_DIR -> PROJECT_ROOT)
BASE_DIR = PROJECT_ROOT
PROJECT_DIR = PROJECT_ROOT
# Name of the directory for the project.
PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1]
# Every cache key will get prefixed with this value - here we set it to
# the name of the directory the project is in to try and use something
# project specific.
CACHE_MIDDLEWARE_KEY_PREFIX = PROJECT
## changed from /site_media/static/
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(Path(__file__).absolute().ancestor(3), STATIC_URL.strip("/"))
#print("STATIC_ROOT: %s" % STATIC_ROOT)
# changed from /site_media/media/