Coverage for ivatar/settings.py: 100%
27 statements
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-26 00:11 +0000
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-26 00:11 +0000
1# -*- coding: utf-8 -*-
2"""
3Django settings for ivatar project.
4"""
6import os
7import logging
9log_level = logging.DEBUG # pylint: disable=invalid-name
10logger = logging.getLogger("ivatar") # pylint: disable=invalid-name
11logger.setLevel(log_level)
13PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
14BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17# SECURITY WARNING: keep the secret key used in production secret!
18SECRET_KEY = "=v(+-^t#ahv^a&&e)uf36g8algj$d1@6ou^w(r0@%)#8mlc*zk"
20# SECURITY WARNING: don't run with debug turned on in production!
21DEBUG = True
23ALLOWED_HOSTS = []
26# Application definition
28INSTALLED_APPS = [
29 "django.contrib.admin",
30 "django.contrib.auth",
31 "django.contrib.contenttypes",
32 "django.contrib.sessions",
33 "django.contrib.messages",
34 "django.contrib.staticfiles",
35]
37MIDDLEWARE = [
38 "django.middleware.security.SecurityMiddleware",
39 "django.contrib.sessions.middleware.SessionMiddleware",
40 "django.middleware.common.CommonMiddleware",
41 "django.middleware.csrf.CsrfViewMiddleware",
42 "django.contrib.auth.middleware.AuthenticationMiddleware",
43 "django.contrib.messages.middleware.MessageMiddleware",
44 "django.middleware.clickjacking.XFrameOptionsMiddleware",
45]
47ROOT_URLCONF = "ivatar.urls"
49TEMPLATES = [
50 {
51 "BACKEND": "django.template.backends.django.DjangoTemplates",
52 "DIRS": [],
53 "APP_DIRS": True,
54 "OPTIONS": {
55 "context_processors": [
56 "django.template.context_processors.debug",
57 "django.template.context_processors.request",
58 "django.contrib.auth.context_processors.auth",
59 "django.contrib.messages.context_processors.messages",
60 ],
61 },
62 },
63]
65WSGI_APPLICATION = "ivatar.wsgi.application"
68# Database
69# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
71DATABASES = {
72 "default": {
73 "ENGINE": "django.db.backends.sqlite3",
74 "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
75 }
76}
79# Password validation
80# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
82AUTH_PASSWORD_VALIDATORS = [
83 {
84 "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", # noqa
85 },
86 {
87 "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", # noqa
88 },
89 {
90 "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", # noqa
91 },
92 {
93 "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", # noqa
94 },
95]
98# Internationalization
99# https://docs.djangoproject.com/en/2.0/topics/i18n/
101LANGUAGE_CODE = "en-us"
103TIME_ZONE = "UTC"
105USE_I18N = True
107USE_L10N = True
109USE_TZ = True
112# Static files configuration (esp. req. during dev.)
113PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
114STATIC_URL = "/static/"
115STATIC_ROOT = os.path.join(BASE_DIR, "static")
117DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
119from config import * # pylint: disable=wildcard-import,wrong-import-position,unused-wildcard-import