当前位置: 首页>>代码示例>>Python>>正文


Python FSPath.ancestor方法代码示例

本文整理汇总了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',
开发者ID:ckhachian,项目名称:PhysIndex,代码行数:32,代码来源:base_settings.py

示例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'
开发者ID:miped,项目名称:cookiecutter-django,代码行数:32,代码来源:base.py

示例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',
开发者ID:aitzol,项目名称:djangoproject.com,代码行数:33,代码来源:www.py

示例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}}
开发者ID:suvitorg,项目名称:work.suvit.ru,代码行数:24,代码来源:settings_prod.py

示例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',
)
开发者ID:rosscdh,项目名称:revision,代码行数:33,代码来源:base.py

示例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': {
开发者ID:oinopion,项目名称:djangoproject.com,代码行数:33,代码来源:common.py

示例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/"
开发者ID:baffolobill,项目名称:CGPeople,代码行数:32,代码来源:base.py

示例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 {
开发者ID:,项目名称:,代码行数:33,代码来源:


注:本文中的unipath.FSPath.ancestor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。