⬅ softdesk/softdesk/settings.py source

1 """
2 Django settings for softdesk project.
3  
4 Generated by 'django-admin startproject' using Django 5.2.1.
5  
6 For more information on this file, see
7 https://docs.djangoproject.com/en/5.2/topics/settings/
8  
9 For the full list of settings and their values, see
10 https://docs.djangoproject.com/en/5.2/ref/settings/
11 """
12  
13 from pathlib import Path
14 from datetime import timedelta
15  
16 # Build paths inside the project like this: BASE_DIR / 'subdir'.
17 BASE_DIR = Path(__file__).resolve().parent.parent
18  
19  
20 # Quick-start development settings - unsuitable for production
21 # See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
22  
23 # SECURITY WARNING: keep the secret key used in production secret!
  • E501 Line too long (81 > 79 characters)
24 SECRET_KEY = 'django-insecure-_vs15jeip&ba(7@n!ptk+b0$4fjhj-esfz1qrhk8+eh4d6k%br'
25  
26 # SECURITY WARNING: don't run with debug turned on in production!
27 DEBUG = True
28  
29 ALLOWED_HOSTS = []
30  
31  
32 # Application definition
33  
34 INSTALLED_APPS = [
35 'django.contrib.admin',
36 'django.contrib.auth',
37 'django.contrib.contenttypes',
38 'django.contrib.sessions',
39 'django.contrib.messages',
40 'django.contrib.staticfiles',
  • W291 Trailing whitespace
41 'rest_framework',
  • W291 Trailing whitespace
42 'rest_framework_simplejwt',
  • W291 Trailing whitespace
43 'authentication',
  • W291 Trailing whitespace
44 'support',
45 ]
46  
47 MIDDLEWARE = [
48 'django.middleware.security.SecurityMiddleware',
49 'django.contrib.sessions.middleware.SessionMiddleware',
50 'django.middleware.common.CommonMiddleware',
51 'django.middleware.csrf.CsrfViewMiddleware',
52 'django.contrib.auth.middleware.AuthenticationMiddleware',
53 'django.contrib.messages.middleware.MessageMiddleware',
54 'django.middleware.clickjacking.XFrameOptionsMiddleware',
55 ]
56  
57 ROOT_URLCONF = 'softdesk.urls'
58  
59 TEMPLATES = [
60 {
61 'BACKEND': 'django.template.backends.django.DjangoTemplates',
62 'DIRS': [],
63 'APP_DIRS': True,
64 'OPTIONS': {
65 'context_processors': [
66 'django.template.context_processors.request',
67 'django.contrib.auth.context_processors.auth',
68 'django.contrib.messages.context_processors.messages',
69 ],
70 },
71 },
72 ]
73  
74 WSGI_APPLICATION = 'softdesk.wsgi.application'
75  
76  
77 # Database
78 # https://docs.djangoproject.com/en/5.2/ref/settings/#databases
79  
80 DATABASES = {
81 'default': {
82 'ENGINE': 'django.db.backends.sqlite3',
83 'NAME': BASE_DIR / 'db.sqlite3',
84 }
85 }
86  
87  
88 # Password validation
89 # https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
90  
91 AUTH_PASSWORD_VALIDATORS = [
92 {
  • E501 Line too long (91 > 79 characters)
93 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
94 },
95 {
  • E501 Line too long (81 > 79 characters)
96 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
97 },
98 {
  • E501 Line too long (82 > 79 characters)
99 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
100 },
101 {
  • E501 Line too long (83 > 79 characters)
102 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
103 },
104 ]
105  
106  
107 # Internationalization
108 # https://docs.djangoproject.com/en/5.2/topics/i18n/
109  
110 LANGUAGE_CODE = 'en-us'
111  
112 TIME_ZONE = 'UTC'
113  
114 USE_I18N = True
115  
116 USE_TZ = True
117  
118  
119 # Static files (CSS, JavaScript, Images)
120 # https://docs.djangoproject.com/en/5.2/howto/static-files/
121  
122 STATIC_URL = 'static/'
123  
124 # Default primary key field type
125 # https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
126  
127 DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
128  
129 AUTH_USER_MODEL = 'authentication.User'
130  
131 REST_FRAMEWORK = {
  • E501 Line too long (105 > 79 characters)
132 'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework_simplejwt.authentication.JWTAuthentication',),
  • E501 Line too long (86 > 79 characters)
133 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
134 'PAGE_SIZE': 5
135 }
136  
137 SIMPLE_JWT = {
138 'ACCESS_TOKEN_LIFETIME': timedelta(days=30),
139 'REFRESH_TOKEN_LIFETIME': timedelta(days=30),
140 }