irongit

Enhanced time synchronization for drf views.

155 lines3.8 KBPython
1"""
2Django settings for example project.
3
4Generated by 'django-admin startproject' using Django 5.2.1.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/5.2/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/5.2/ref/settings/
11"""
12
13from pathlib import Path
14
15LOGGING = {
16 "version": 1,
17 "disable_existing_loggers": False,
18 "handlers": {
19 "console": {
20 "class": "logging.StreamHandler",
21 },
22 },
23 "root": {
24 "handlers": ["console"],
25 "level": "DEBUG",
26 },
27 "loggers": {
28 "django": {
29 "handlers": ["console"],
30 "level": "ERROR",
31 "propagate": False,
32 },
33 # optionally:
34 "timecheck": {
35 "handlers": ["console"],
36 "level": "DEBUG",
37 "propagate": False,
38 },
39 },
40}
41
42# TimeCheck Conf
43TIMECHECK_CONF = {"noupdate_code": 420}
44
45
46# Build paths inside the project like this: BASE_DIR / 'subdir'.
47BASE_DIR = Path(__file__).resolve().parent.parent
48
49
50# Quick-start development settings - unsuitable for production
51# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
52
53# SECURITY WARNING: keep the secret key used in production secret!
54SECRET_KEY = "django-insecure-=%r#z55prje)c3*m*e(xim*&k3)4m=4lqljp)4j)k+5ppk(fz6"
55
56# SECURITY WARNING: don't run with debug turned on in production!
57DEBUG = True
58
59ALLOWED_HOSTS = []
60
61
62# Application definition
63
64INSTALLED_APPS = [
65 "django.contrib.admin",
66 "django.contrib.auth",
67 "django.contrib.contenttypes",
68 "django.contrib.sessions",
69 "django.contrib.messages",
70 "django.contrib.staticfiles",
71 "rest_framework",
72 "example_app",
73]
74
75MIDDLEWARE = [
76 "django.middleware.security.SecurityMiddleware",
77 "django.contrib.sessions.middleware.SessionMiddleware",
78 "django.middleware.common.CommonMiddleware",
79 "django.middleware.csrf.CsrfViewMiddleware",
80 "django.contrib.auth.middleware.AuthenticationMiddleware",
81 "django.contrib.messages.middleware.MessageMiddleware",
82 "django.middleware.clickjacking.XFrameOptionsMiddleware",
83]
84
85ROOT_URLCONF = "example_project.urls"
86
87TEMPLATES = [
88 {
89 "BACKEND": "django.template.backends.django.DjangoTemplates",
90 "DIRS": [],
91 "APP_DIRS": True,
92 "OPTIONS": {
93 "context_processors": [
94 "django.template.context_processors.request",
95 "django.contrib.auth.context_processors.auth",
96 "django.contrib.messages.context_processors.messages",
97 ],
98 },
99 },
100]
101
102WSGI_APPLICATION = "example_project.wsgi.application"
103
104
105# Database
106# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
107
108DATABASES = {
109 "default": {
110 "ENGINE": "django.db.backends.sqlite3",
111 "NAME": BASE_DIR / "db.sqlite3",
112 }
113}
114
115
116# Password validation
117# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
118
119AUTH_PASSWORD_VALIDATORS = [
120 {
121 "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
122 },
123 {
124 "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
125 },
126 {
127 "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
128 },
129 {
130 "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
131 },
132]
133
134
135# Internationalization
136# https://docs.djangoproject.com/en/5.2/topics/i18n/
137
138LANGUAGE_CODE = "en-us"
139
140TIME_ZONE = "UTC"
141
142USE_I18N = True
143
144USE_TZ = True
145
146
147# Static files (CSS, JavaScript, Images)
148# https://docs.djangoproject.com/en/5.2/howto/static-files/
149
150STATIC_URL = "static/"
151
152# Default primary key field type
153# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
154
155DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"