Coverage for ivatar/settings.py: 100%

27 statements  

« 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""" 

5 

6import os 

7import logging 

8 

9log_level = logging.DEBUG # pylint: disable=invalid-name 

10logger = logging.getLogger("ivatar") # pylint: disable=invalid-name 

11logger.setLevel(log_level) 

12 

13PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) 

14BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 

15 

16 

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" 

19 

20# SECURITY WARNING: don't run with debug turned on in production! 

21DEBUG = True 

22 

23ALLOWED_HOSTS = [] 

24 

25 

26# Application definition 

27 

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] 

36 

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] 

46 

47ROOT_URLCONF = "ivatar.urls" 

48 

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] 

64 

65WSGI_APPLICATION = "ivatar.wsgi.application" 

66 

67 

68# Database 

69# https://docs.djangoproject.com/en/2.0/ref/settings/#databases 

70 

71DATABASES = { 

72 "default": { 

73 "ENGINE": "django.db.backends.sqlite3", 

74 "NAME": os.path.join(BASE_DIR, "db.sqlite3"), 

75 } 

76} 

77 

78 

79# Password validation 

80# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators 

81 

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] 

96 

97 

98# Internationalization 

99# https://docs.djangoproject.com/en/2.0/topics/i18n/ 

100 

101LANGUAGE_CODE = "en-us" 

102 

103TIME_ZONE = "UTC" 

104 

105USE_I18N = True 

106 

107USE_L10N = True 

108 

109USE_TZ = True 

110 

111 

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") 

116 

117DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" 

118 

119from config import * # pylint: disable=wildcard-import,wrong-import-position,unused-wildcard-import