Skip to content

Commit 4cb65fa

Browse files
authored
Update settings.py
1 parent f2455de commit 4cb65fa

File tree

1 file changed

+57
-14
lines changed

1 file changed

+57
-14
lines changed

settings.py

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
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+
113
import os
214
from pathlib import Path
3-
import dj_database_url # Make sure this is imported
15+
import dj_database_url # Import dj_database_url
416

517
# Build paths inside the project like this: BASE_DIR / 'subdir'.
618
BASE_DIR = Path(__file__).resolve().parent.parent
719

20+
21+
# Quick-start development settings - unsuitable for production
22+
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
23+
824
# SECURITY WARNING: keep the secret key used in production secret!
925
# 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')
1127

1228
# 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)
1430
DEBUG = os.environ.get('DEBUG', 'False') == 'True'
1531

1632
# Get the ALLOWED_HOSTS from Render's environment variable
@@ -19,15 +35,17 @@
1935
if RENDER_EXTERNAL_HOSTNAME:
2036
ALLOWED_HOSTS.append(RENDER_EXTERNAL_HOSTNAME)
2137

38+
2239
# Application definition
40+
2341
INSTALLED_APPS = [
2442
"django.contrib.admin",
2543
"django.contrib.auth",
2644
"django.contrib.contenttypes",
2745
"django.contrib.sessions",
2846
"django.contrib.messages",
2947
"django.contrib.staticfiles",
30-
'onsapp', # Your app
48+
'onsapp',
3149
]
3250

3351
MIDDLEWARE = [
@@ -42,7 +60,7 @@
4260
"django.middleware.clickjacking.XFrameOptionsMiddleware",
4361
]
4462

45-
ROOT_URLCONF = "ons_trading.urls" # Corrected from your_project_name
63+
ROOT_URLCONF = "ons_trading.urls"
4664

4765
TEMPLATES = [
4866
{
@@ -60,10 +78,12 @@
6078
},
6179
]
6280

63-
WSGI_APPLICATION = "ons_trading.wsgi.application" # Corrected from your_project_name
81+
WSGI_APPLICATION = "ons_trading.wsgi.application"
82+
6483

6584
# Database
6685
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
86+
6787
# This setup uses dj_database_url to read the DATABASE_URL env var from Render
6888
DATABASES = {
6989
'default': dj_database_url.config(
@@ -73,28 +93,51 @@
7393
)
7494
}
7595

96+
7697
# Password validation
98+
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
99+
77100
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+
},
82113
]
83114

115+
84116
# Internationalization
117+
# https://docs.djangoproject.com/en/5.2/topics/i18n/
118+
85119
LANGUAGE_CODE = "en-us"
120+
86121
TIME_ZONE = 'Asia/Kolkata'
87-
USE_I18N = True
122+
123+
USE_I1N = True
124+
88125
USE_TZ = True
89126

127+
90128
# Static files (CSS, JavaScript, Images)
91129
# 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.
94134
STATIC_ROOT = BASE_DIR / 'staticfiles'
95135

96-
# Enable WhiteNoise storage
136+
# Enable WhiteNoise to serve static files efficiently.
97137
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
98138

139+
99140
# Default primary key field type
141+
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
142+
100143
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

0 commit comments

Comments
 (0)