示例#1
0
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)


# Templates
# https://docs.djangoproject.com/en/2.2/ref/templates/api

TEMPLATES = [{
    'APP_DIRS': True,
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [
        # Contains plain text templates, like `robots.txt`:
        BASE_DIR.joinpath('server', 'templates'),
    ],
    'OPTIONS': {
        'context_processors': [
            # Default template context processors:
            'django.contrib.auth.context_processors.auth',
            'django.template.context_processors.debug',
            'django.template.context_processors.i18n',
            'django.template.context_processors.media',
            'django.contrib.messages.context_processors.messages',
            'django.template.context_processors.request',
        ],
    },
}]

示例#2
0
}

LANGUAGE_CODE = 'en-us'

USE_I18N = True
USE_L10N = True

LANGUAGES = (('en', _('English')), ('ru', _('Russian')))

LOCALE_PATHS = ('locale/', )

USE_TZ = True
TIME_ZONE = 'UTC'

STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR.joinpath('static')

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

TEMPLATES = [
    {
        'APP_DIRS': True,
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [BASE_DIR.joinpath('server', 'templates')],
        'OPTIONS': {
            'context_processors': [
                'django.contrib.auth.context_processors.auth',
                'django.template.context_processors.debug',
示例#3
0
LANGUAGES = (("en", "English"), )

USE_TZ = True
TIME_ZONE = "UTC"

# Templates
# https://docs.djangoproject.com/en/1.11/ref/templates/api

TEMPLATES = [{
    "APP_DIRS":
    True,
    "BACKEND":
    "django.template.backends.django.DjangoTemplates",
    "DIRS": [
        # Contains plain text templates, like `robots.txt`:
        BASE_DIR.joinpath("server", "templates"),
    ],
    "OPTIONS": {
        "context_processors": [
            # default template context processors
            "django.contrib.auth.context_processors.auth",
            "django.template.context_processors.debug",
            "django.contrib.messages.context_processors.messages",
            "django.template.context_processors.request",
        ],
    },
}]

REST_FRAMEWORK = {
    "DEFAULT_RENDERER_CLASSES": ("rest_framework.renderers.JSONRenderer", ),
    "DEFAULT_PARSER_CLASSES": ("rest_framework.parsers.JSONParser", ),
STATICFILES_FINDERS = (
    "django.contrib.staticfiles.finders.FileSystemFinder",
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
)

# Templates
# https://docs.djangoproject.com/en/2.2/ref/templates/api

TEMPLATES = [
    {
        "APP_DIRS": True,
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [
            # Contains plain text templates, like `robots.txt`:
            BASE_DIR.joinpath("server", "templates"),
        ],
        "OPTIONS": {
            "context_processors": [
                # Default template context processors:
                "django.contrib.auth.context_processors.auth",
                "django.template.context_processors.debug",
                "django.template.context_processors.i18n",
                "django.template.context_processors.media",
                "django.contrib.messages.context_processors.messages",
                "django.template.context_processors.request",
            ],
        },
    }
]
示例#5
0
# -*- coding:utf-8 -*-

from server.settings.components import BASE_DIR

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql_psycopg2",
        "NAME": "resumemakr_test_d",
        "USER": "******",
        "PASSWORD": "******",
        "HOST": "localhost",
        "PORT": 5432,
        "OPTIONS": {
            "connect_timeout": 10
        },
    }
}

PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]

AUTHENTICATION_BACKENDS = ("django.contrib.auth.backends.ModelBackend", )

MEDIA_ROOT = BASE_DIR.joinpath("tests/media")
示例#6
0
STATICFILES_FINDERS = (
    "django.contrib.staticfiles.finders.FileSystemFinder",
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
)

# Templates
# https://docs.djangoproject.com/en/2.2/ref/templates/api

TEMPLATES = [{
    "APP_DIRS":
    True,
    "BACKEND":
    "django.template.backends.django.DjangoTemplates",
    "DIRS": [
        # Contains plain text templates, like `robots.txt`:
        BASE_DIR.joinpath("server", "templates"),
    ],
    "OPTIONS": {
        "context_processors": [
            # Default template context processors:
            "django.contrib.auth.context_processors.auth",
            "django.template.context_processors.debug",
            "django.template.context_processors.i18n",
            "django.template.context_processors.media",
            "django.contrib.messages.context_processors.messages",
            "django.template.context_processors.request",
        ],
    },
}]

# Media files
示例#7
0
WSGI_APPLICATION = 'server.wsgi.application'

ADMIN_URL = config('ADMIN_URL', default='admin/')

# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases


DATABASES = {
    'default': {
        # Choices are: postgresql_psycopg2, mysql, sqlite3, oracle
        'ENGINE': config('DB_ENGINE'),

        # Database name or filepath if using 'sqlite3':
        'NAME': config('DB_NAME',
                       default=BASE_DIR.joinpath('db.sqlite3').as_posix()),

        # You don't need these settings if using 'sqlite3':
        'USER': config('DB_USER'),
        'PASSWORD': config('DB_PASS'),
        'HOST': config('DB_HOST'),
        'PORT': config('DB_PORT', cast=int),
        'CONN_MAX_AGE': config('CONN_MAX_AGE', cast=int, default=60),
    },
}

# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/

LANGUAGE_CODE = 'en-us'
示例#8
0
LANGUAGES = (("en", "English"), )

USE_TZ = True
TIME_ZONE = "UTC"

# Templates
# https://docs.djangoproject.com/en/1.11/ref/templates/api

TEMPLATES = [{
    "APP_DIRS":
    True,
    "BACKEND":
    "django.template.backends.django.DjangoTemplates",
    "DIRS": [
        # Contains plain text templates, like `robots.txt`:
        BASE_DIR.joinpath("server", "templates"),
    ],
    "OPTIONS": {
        "context_processors": [
            # default template context processors
            "django.contrib.auth.context_processors.auth",
            "django.template.context_processors.debug",
            "django.contrib.messages.context_processors.messages",
            "django.template.context_processors.request",
        ],
    },
}]

STATIC_URL = "/static/"

STATICFILES_FINDERS = (