Skip to content

Commit

Permalink
Remove unused / unneeded options from settings
Browse files Browse the repository at this point in the history
1. Remove CONF_DIR. It was left over when the files in the conf directory
   were moved up to the demo directory.

2. Remove the CACHES setting. It was left over then the code was first
   added. There's no caching implemented in the demo site.

3. Add debug-toolbar to the middleware. It got left out by mistake.

4. Correct the module path in the ROOT_URLCONF setting.

5. Remove demo/templates from "DIRS" in the Templates setting. It is
   already added to the search with "APP_DIRS" set to True.
  • Loading branch information
StuartMacKay committed Oct 22, 2023
1 parent df6ea01 commit 19310b2
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions demo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

DEBUG = True

CONF_DIR = os.path.dirname(os.path.abspath(__file__))
DEMO_DIR = os.path.dirname(CONF_DIR)
DEMO_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(DEMO_DIR)

SECRET_KEY = "+^%b!5_!ul7prtm_y0w_xluJg32aqna&+)&thhy3)jqr2g*0%s"
Expand All @@ -30,16 +29,17 @@
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"debug_toolbar.middleware.DebugToolbarMiddleware",
]

ROOT_URLCONF = "demo.conf.urls"
ROOT_URLCONF = "demo.urls"

STATIC_URL = "/static/"

TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [os.path.join(DEMO_DIR, "templates")],
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
Expand All @@ -64,13 +64,6 @@

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATION": "site",
}
}

INTERNAL_IPS = [
"127.0.0.1",
]
Expand Down Expand Up @@ -108,4 +101,3 @@
},
},
}

0 comments on commit 19310b2

Please sign in to comment.