0Pricing
Django Academy · Lesson

Touring settings.py

The key settings every project depends on.

Touring settings.py is a free Django Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Django Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

One File, Whole Project

The settings.py file is the control panel for your entire project. Nearly every Django behavior is configured from this one place. 🎛️

It Is Just Python

Settings are plain Python variables, so you can compute them with code. That flexibility is powerful, but it means typos break startup loudly.

BASE_DIR Anchors Paths

BASE_DIR points to your project root. Other settings build paths from it so your app works no matter where it is installed.

BASE_DIR = Path(__file__).resolve().parent.parent

DEBUG Controls Detail

DEBUG shows rich error pages while you build. You must set it to False in production, or you leak sensitive details to visitors. ⚠️

DEBUG = True

SECRET_KEY Signs Things

The SECRET_KEY secures sessions, cookies, and password resets. Keep it private and never commit the real one to version control.

ALLOWED_HOSTS Guards Access

ALLOWED_HOSTS lists the domains your site may serve. It blocks requests with a faked Host header, an important safety check.

ALLOWED_HOSTS = ["example.com"]

INSTALLED_APPS Lives Here

The familiar INSTALLED_APPS list sits in settings too. It declares which apps, yours and Django's, are active in this project.

MIDDLEWARE Wraps Requests

The MIDDLEWARE list defines layers that process every request and response, handling things like security and sessions in order.

DATABASES Defines Storage

The DATABASES setting tells Django where to store data. New projects start with SQLite, a simple file-based database.

DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3"}}

TEMPLATES and Static

TEMPLATES configures HTML rendering, while STATIC_URL sets where CSS and JS are served from. Both shape how pages reach the browser.

Locale and Time

Settings like TIME_ZONE and LANGUAGE_CODE control formatting and translation, so your app feels right for its users worldwide. 🌍

TIME_ZONE = "UTC"

Quick Check

Which setting must be False before you go live?

Recap: You Know the Panel

You toured settings.py: BASE_DIR, DEBUG, SECRET_KEY, ALLOWED_HOSTS, apps, middleware, and databases. This file steers the whole project. 🧭

Frequently asked questions

Is the “Touring settings.py” lesson free?

Yes — the full text of “Touring settings.py” is free to read here on the web, and the Django Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Django Academy course, upgrade to CoddyKit PRO.

What will I learn in “Touring settings.py”?

The key settings every project depends on. You practise Django Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Django Academy?

No prior experience is required. Django Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Touring settings.py” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Django Academy lesson?

Yes. Every Django Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. startapp and the App Folder Layout
  2. Register Apps in INSTALLED_APPS
  3. Touring settings.py
  4. manage.py: Your Command Center
← Back to Django Academy