Skip to content

Commit 70199fb

Browse files
added requirements file and also added dj_database_url library and modified the setting files
1 parent a4c89c6 commit 70199fb

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

db.sqlite3

0 Bytes
Binary file not shown.
Binary file not shown.

myFirstDjangoProject/settings.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from pathlib import Path
1414
import os
1515
from decouple import config
16+
from decouple import Csv
17+
import dj_database_url
1618

1719
# Build paths inside the project like this: BASE_DIR / 'subdir'.
1820
BASE_DIR = Path(__file__).resolve().parent.parent
@@ -23,13 +25,15 @@
2325

2426
# SECURITY WARNING: keep the secret key used in production secret!
2527
SECRET_KEY = config('SECRET_KEY')
26-
SECRET_KEY = 'django-insecure-nx=a-t0d%tf4*mrws4hq_o1=9e&ko$#pntt3)6bva=lfim7vm5'
2728

28-
# SECURITY WARNING: don't run with debug turned on in production!
29-
DEBUG = True
29+
DEBUG = config('DEBUG', default = False, cast=bool)
30+
31+
ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv())
3032

31-
ALLOWED_HOSTS = []
33+
#SECRET_KEY = 'django-insecure-nx=a-t0d%tf4*mrws4hq_o1=9e&ko$#pntt3)6bva=lfim7vm5'
3234

35+
# SECURITY WARNING: don't run with debug turned on in production!
36+
#DEBUG = True
3337

3438
# Application definition
3539

@@ -83,14 +87,19 @@
8387
# Database
8488
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
8589

90+
# DATABASES = {
91+
# 'default': {
92+
# 'ENGINE': 'django.db.backends.sqlite3',
93+
# 'NAME': BASE_DIR / 'db.sqlite3',
94+
# }
95+
# }
96+
8697
DATABASES = {
87-
'default': {
88-
'ENGINE': 'django.db.backends.sqlite3',
89-
'NAME': BASE_DIR / 'db.sqlite3',
90-
}
98+
'default': dj_database_url.config(
99+
default=config('DATABASE_URL')
100+
)
91101
}
92102

93-
94103
# Password validation
95104
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
96105

requirements.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
asgiref==3.5.0
2+
dj-database-url==0.5.0
3+
Django==4.0.2
4+
django-widget-tweaks==1.4.12
5+
importlib-metadata==4.11.1
6+
Markdown==3.3.6
7+
python-decouple==3.6
8+
sqlparse==0.4.2
9+
tzdata==2021.5
10+
zipp==3.7.0

0 commit comments

Comments
 (0)