1 | # settings.py
|
---|
2 |
|
---|
3 | import os
|
---|
4 | from pathlib import Path
|
---|
5 |
|
---|
6 | # Base directory of the project
|
---|
7 | BASE_DIR = Path(__file__).resolve().parent.parent
|
---|
8 |
|
---|
9 | # Security settings
|
---|
10 | SECRET_KEY = 'your-secret-key-here'
|
---|
11 | DEBUG = True
|
---|
12 |
|
---|
13 | ALLOWED_HOSTS = ["*"]
|
---|
14 |
|
---|
15 | # Installed apps
|
---|
16 | INSTALLED_APPS = [
|
---|
17 | 'django.contrib.admin',
|
---|
18 | 'django.contrib.auth',
|
---|
19 | 'django.contrib.contenttypes',
|
---|
20 | 'django.contrib.sessions',
|
---|
21 | 'django.contrib.messages',
|
---|
22 | 'django.contrib.staticfiles',
|
---|
23 | ]
|
---|
24 |
|
---|
25 | # Middleware
|
---|
26 | MIDDLEWARE = [
|
---|
27 | 'django.middleware.security.SecurityMiddleware',
|
---|
28 | 'django.contrib.sessions.middleware.SessionMiddleware',
|
---|
29 | 'django.middleware.common.CommonMiddleware',
|
---|
30 | 'django.middleware.csrf.CsrfViewMiddleware',
|
---|
31 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
---|
32 | 'django.contrib.messages.middleware.MessageMiddleware',
|
---|
33 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
---|
34 | ]
|
---|
35 |
|
---|
36 | # URL configuration
|
---|
37 | ROOT_URLCONF = 'myproject.urls'
|
---|
38 |
|
---|
39 | # Template settings
|
---|
40 | TEMPLATES = [
|
---|
41 | {
|
---|
42 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
---|
43 | 'DIRS': [],
|
---|
44 | 'APP_DIRS': True,
|
---|
45 | 'OPTIONS': {
|
---|
46 | 'context_processors': [
|
---|
47 | 'django.template.context_processors.debug',
|
---|
48 | 'django.template.context_processors.request',
|
---|
49 | 'django.contrib.auth.context_processors.auth',
|
---|
50 | 'django.contrib.messages.context_processors.messages',
|
---|
51 | ],
|
---|
52 | },
|
---|
53 | },
|
---|
54 | ]
|
---|
55 |
|
---|
56 | # WSGI application
|
---|
57 | WSGI_APPLICATION = 'myproject.wsgi.application'
|
---|
58 |
|
---|
59 | # Database
|
---|
60 | DATABASES = {
|
---|
61 | 'default': {
|
---|
62 | 'ENGINE': 'django.db.backends.sqlite3',
|
---|
63 | 'NAME': BASE_DIR / 'failure.sqlite3',
|
---|
64 | }
|
---|
65 | }
|
---|
66 |
|
---|
67 | # Password validation
|
---|
68 | AUTH_PASSWORD_VALIDATORS = [
|
---|
69 | {
|
---|
70 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
---|
71 | },
|
---|
72 | {
|
---|
73 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
---|
74 | },
|
---|
75 | {
|
---|
76 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
---|
77 | },
|
---|
78 | {
|
---|
79 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
---|
80 | },
|
---|
81 | ]
|
---|
82 |
|
---|
83 | # Internationalization
|
---|
84 | LANGUAGE_CODE = 'en-us'
|
---|
85 | TIME_ZONE = 'UTC'
|
---|
86 | USE_I18N = True
|
---|
87 | USE_TZ = True
|
---|
88 |
|
---|
89 | # Static files
|
---|
90 | STATIC_URL = '/static/'
|
---|
91 |
|
---|
92 | # Default primary key field type
|
---|
93 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
---|