本文整理汇总了Python中unipath.FSPath.ancestor方法的典型用法代码示例。如果您正苦于以下问题:Python FSPath.ancestor方法的具体用法?Python FSPath.ancestor怎么用?Python FSPath.ancestor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unipath.FSPath
的用法示例。
在下文中一共展示了FSPath.ancestor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from unipath import FSPath [as 别名]
# 或者: from unipath.FSPath import ancestor [as 别名]
SITE_ID = 1
USE_I18N = True
USE_L10N = True
USE_TZ = True
MEDIA_ROOT = BASE.child('media')
MEDIA_URL = '/m/'
SOUTH_TESTS_MIGRATE = False
STATIC_ROOT = BASE.ancestor(1).child('static_root')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
BASE.ancestor(1).child('wsgi').child('static'),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
示例2: files
# 需要导入模块: from unipath import FSPath [as 别名]
# 或者: from unipath.FSPath import ancestor [as 别名]
EMAIL_PORT = email_config['EMAIL_PORT']
EMAIL_BACKEND = email_config['EMAIL_BACKEND']
EMAIL_USE_TLS = email_config['EMAIL_USE_TLS']
# Dates and times
USE_TZ = True
TIME_ZONE = 'UTC'
# Internationalization
LANGUAGE_CODE = 'en-us'
USE_I18N = True
USE_L10N = True
# Media files (Uploads)
MEDIA_URL = env('MEDIA_URL', '/media/')
MEDIA_ROOT = env('MEDIA_ROOT', PROJECT_DIR.ancestor(1).child('media'))
# Static files (CSS, JavaScript, Images)
STATIC_URL = env('STATIC_URL', '/static/')
STATIC_ROOT = env('STATIC_ROOT', PROJECT_DIR.ancestor(1).child('static'))
STATICFILES_DIRS = (
PROJECT_DIR.ancestor(1).child('assets', '_build', 'base'),
PROJECT_DIR.ancestor(1).child('assets', '_build', 'img'),
)
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
# Templates
DEFAULT_JINJA2_TEMPLATE_EXTENSION = '.jinja2'
示例3: Path
# 需要导入模块: from unipath import FSPath [as 别名]
# 或者: from unipath.FSPath import ancestor [as 别名]
# Settings for www.djangoproject.com
import os
import json
import platform
from unipath import FSPath as Path
# The full path to the django_website directory.
BASE = Path(__file__).absolute().ancestor(2)
# Far too clever trick to know if we're running on the deployment server.
PRODUCTION = ('DJANGOPROJECT_DEBUG' not in os.environ) and ("djangoproject" in platform.node())
# It's a secret to everybody
SECRETS = json.load(open(BASE.ancestor(2).child('secrets.json')))
SECRET_KEY = str(SECRETS['secret_key'])
ADMINS = (('Adrian Holovaty','[email protected]'),('Jacob Kaplan-Moss', '[email protected]'))
MANAGERS = (('Jacob Kaplan-Moss','[email protected]'),)
TIME_ZONE = 'America/Chicago'
SERVER_EMAIL = '[email protected]'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'djangoproject',
'USER': 'djangoproject'
},
'trac': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'code.djangoproject',
示例4: Path
# 需要导入模块: from unipath import FSPath [as 别名]
# 或者: from unipath.FSPath import ancestor [as 别名]
import os
import json
from unipath import FSPath as Path
# The full path to the django_website directory.
BASE = Path(__file__).absolute().ancestor(2)
SECRETS = json.load(open(BASE.ancestor(1).child("secrets.json")))
DEBUG = False
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": "{{remote_dir}}/data/base.sqlite"}}
CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache", "TIMEOUT": 300}}
CACHE_MIDDLEWARE_KEY_PREFIX = "suvitatwork"
MEDIA_ROOT = os.path.join("{{remote_dir}}", "media", "media")
STATIC_ROOT = os.path.join("{{remote_dir}}", "media", "static")
SENTRY_DSN = str(SECRETS["sentry_dsn"])
{{settings_logging}}
示例5: files
# 需要导入模块: from unipath import FSPath [as 别名]
# 或者: from unipath.FSPath import ancestor [as 别名]
EMAIL_USE_TLS = email_config['EMAIL_USE_TLS']
TEMPLATED_EMAIL_BACKEND = 'templated_email.backends.vanilla_django'
# Dates and times
USE_TZ = True
TIME_ZONE = 'UTC'
# Internationalization
LANGUAGE_CODE = 'en-us'
USE_I18N = True
USE_L10N = True
# Media files (Uploads)
MEDIA_URL = env('MEDIA_URL', '/media/')
MEDIA_ROOT = env('MEDIA_ROOT', PROJECT_DIR.ancestor(1).child('media'))
# Static files (CSS, JavaScript, Images)
STATIC_URL = env('STATIC_URL', '/static/')
STATIC_ROOT = env('STATIC_ROOT', PROJECT_DIR.ancestor(1).child('static'))
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'pipeline.finders.FileSystemFinder',
# 'pipeline.finders.AppDirectoriesFinder',
# 'pipeline.finders.PipelineFinder',
# 'pipeline.finders.CachedFileFinder',
)
示例6: Path
# 需要导入模块: from unipath import FSPath [as 别名]
# 或者: from unipath.FSPath import ancestor [as 别名]
# Settings for www.djangoproject.com
import json
from unipath import FSPath as Path
# Utilities
# The full path to the repository root.
BASE = Path(__file__).absolute().ancestor(2)
# It's a secret to everybody
try:
with open(BASE.ancestor(2).child('conf').child('secrets.json')) as handle:
SECRETS = json.load(handle)
except IOError:
SECRETS = {
'secret_key': 'a',
'superfeedr_creds': ['[email protected]', 'some_string'],
}
# Django settings
CACHE_MIDDLEWARE_SECONDS = 60 * 5 # 5 minutes
CACHE_MIDDLEWARE_KEY_PREFIX = 'django'
CSRF_COOKIE_HTTPONLY = True
DATABASES = {
'default': {
示例7: Path
# 需要导入模块: from unipath import FSPath [as 别名]
# 或者: from unipath.FSPath import ancestor [as 别名]
TIME_ZONE = "America/Los_Angeles"
LANGUAGE_CODE = "en-us"
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = False
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = Path(PROJECT_ROOT.ancestor(1), "media")
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '/media/'
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = Path(PROJECT_ROOT.ancestor(1), "static0")
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = "/static/"
示例8: Path
# 需要导入模块: from unipath import FSPath [as 别名]
# 或者: from unipath.FSPath import ancestor [as 别名]
import os
import platform
from unipath import FSPath as Path
print os.environ
### Utilities
# The full path to the repository root.
BASE = Path(__file__).absolute().ancestor(2)
# Far too clever trick to know if we're running on the deployment server.
PRODUCTION = False #('DJANGOPROJECT_DEBUG' not in os.environ)
# It's a secret to everybody
with open(BASE.ancestor(1).child('secrets.json')) as handle:
SECRETS = json.load(handle)
### Django settings
ADMINS = (
('Adrian Holovaty', '[email protected]'),
('Jacob Kaplan-Moss', '[email protected]'),
)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': SECRETS.get('memcached_host', '127.0.0.1:11211'),
} if PRODUCTION else {