|
| 1 | +""" |
| 2 | +Django settings for ons_trading 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 | + |
1 | 13 | import os |
2 | 14 | from pathlib import Path |
3 | | -import dj_database_url # Make sure this is imported |
| 15 | +import dj_database_url # Import dj_database_url |
4 | 16 |
|
5 | 17 | # Build paths inside the project like this: BASE_DIR / 'subdir'. |
6 | 18 | BASE_DIR = Path(__file__).resolve().parent.parent |
7 | 19 |
|
| 20 | + |
| 21 | +# Quick-start development settings - unsuitable for production |
| 22 | +# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/ |
| 23 | + |
8 | 24 | # SECURITY WARNING: keep the secret key used in production secret! |
9 | 25 | # Get the SECRET_KEY from a Render environment variable |
10 | | -SECRET_KEY = os.environ.get('SECRET_KEY', 'default-dev-secret-key-replace-me') |
| 26 | +SECRET_KEY = os.environ.get('SECRET_KEY', 'django-insecure-n&a6vut67vp5ysh09jvsts&6%m5e*b_#hr82iuw(1dk^d18yok') |
11 | 27 |
|
12 | 28 | # SECURITY WARNING: don't run with debug turned on in production! |
13 | | -# Get DEBUG status from a Render environment variable |
| 29 | +# Get DEBUG status from a Render environment variable (defaults to False) |
14 | 30 | DEBUG = os.environ.get('DEBUG', 'False') == 'True' |
15 | 31 |
|
16 | 32 | # Get the ALLOWED_HOSTS from Render's environment variable |
|
19 | 35 | if RENDER_EXTERNAL_HOSTNAME: |
20 | 36 | ALLOWED_HOSTS.append(RENDER_EXTERNAL_HOSTNAME) |
21 | 37 |
|
| 38 | + |
22 | 39 | # Application definition |
| 40 | + |
23 | 41 | INSTALLED_APPS = [ |
24 | 42 | "django.contrib.admin", |
25 | 43 | "django.contrib.auth", |
26 | 44 | "django.contrib.contenttypes", |
27 | 45 | "django.contrib.sessions", |
28 | 46 | "django.contrib.messages", |
29 | 47 | "django.contrib.staticfiles", |
30 | | - 'onsapp', # Your app |
| 48 | + 'onsapp', |
31 | 49 | ] |
32 | 50 |
|
33 | 51 | MIDDLEWARE = [ |
|
42 | 60 | "django.middleware.clickjacking.XFrameOptionsMiddleware", |
43 | 61 | ] |
44 | 62 |
|
45 | | -ROOT_URLCONF = "ons_trading.urls" # Corrected from your_project_name |
| 63 | +ROOT_URLCONF = "ons_trading.urls" |
46 | 64 |
|
47 | 65 | TEMPLATES = [ |
48 | 66 | { |
|
60 | 78 | }, |
61 | 79 | ] |
62 | 80 |
|
63 | | -WSGI_APPLICATION = "ons_trading.wsgi.application" # Corrected from your_project_name |
| 81 | +WSGI_APPLICATION = "ons_trading.wsgi.application" |
| 82 | + |
64 | 83 |
|
65 | 84 | # Database |
66 | 85 | # https://docs.djangoproject.com/en/5.2/ref/settings/#databases |
| 86 | + |
67 | 87 | # This setup uses dj_database_url to read the DATABASE_URL env var from Render |
68 | 88 | DATABASES = { |
69 | 89 | 'default': dj_database_url.config( |
|
73 | 93 | ) |
74 | 94 | } |
75 | 95 |
|
| 96 | + |
76 | 97 | # Password validation |
| 98 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators |
| 99 | + |
77 | 100 | AUTH_PASSWORD_VALIDATORS = [ |
78 | | - {"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",}, |
79 | | - {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",}, |
80 | | - {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",}, |
81 | | - {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",}, |
| 101 | + { |
| 102 | + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", |
| 103 | + }, |
| 104 | + { |
| 105 | + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", |
| 106 | + }, |
| 107 | + { |
| 108 | + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", |
| 109 | + }, |
| 110 | + { |
| 111 | + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", |
| 112 | + }, |
82 | 113 | ] |
83 | 114 |
|
| 115 | + |
84 | 116 | # Internationalization |
| 117 | +# https://docs.djangoproject.com/en/5.2/topics/i18n/ |
| 118 | + |
85 | 119 | LANGUAGE_CODE = "en-us" |
| 120 | + |
86 | 121 | TIME_ZONE = 'Asia/Kolkata' |
87 | | -USE_I18N = True |
| 122 | + |
| 123 | +USE_I1N = True |
| 124 | + |
88 | 125 | USE_TZ = True |
89 | 126 |
|
| 127 | + |
90 | 128 | # Static files (CSS, JavaScript, Images) |
91 | 129 | # https://docs.djangoproject.com/en/5.2/howto/static-files/ |
92 | | -STATIC_URL = "/static/" |
93 | | -# This is where collectstatic will gather files for WhiteNoise |
| 130 | + |
| 131 | +STATIC_URL = "static/" |
| 132 | + |
| 133 | +# This is the directory where collectstatic will gather all static files. |
94 | 134 | STATIC_ROOT = BASE_DIR / 'staticfiles' |
95 | 135 |
|
96 | | -# Enable WhiteNoise storage |
| 136 | +# Enable WhiteNoise to serve static files efficiently. |
97 | 137 | STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' |
98 | 138 |
|
| 139 | + |
99 | 140 | # Default primary key field type |
| 141 | +# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field |
| 142 | + |
100 | 143 | DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
0 commit comments