Projects and Apps
Structure a Django project.
Projects and Apps is a free Python Academy lesson on CoddyKit — lesson 1 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 Python Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What is Django?
Django is a batteries-included Python web framework. It bundles an ORM, admin site, templating, and more so you can build full-featured sites quickly. Install with pip install django.
import django
print('Django version:', django.get_version())Projects vs Apps
Django separates two concepts:
- A project is the whole website, with its settings.
- An app is a reusable module inside it, like a blog or a shop.
One project contains many apps.
# project = the site
# app = a feature module within it
print('Project holds many apps')Starting a Project
The command django-admin startproject mysite scaffolds a new project directory with the core files.
# Terminal:
# django-admin startproject mysite
print('startproject creates the site skeleton')Project Layout
A new project contains manage.py and an inner package with settings.py, urls.py, wsgi.py, and asgi.py.
# mysite/
# manage.py
# mysite/
# settings.py
# urls.py
# wsgi.py
print('manage.py + inner config package')manage.py
manage.py is your command-line entry point. You run tasks like the dev server and migrations through it.
# python manage.py runserver
# python manage.py migrate
# python manage.py createsuperuser
print('manage.py runs project commands')Creating an App
python manage.py startapp blog generates a new app folder with its own models, views, and admin files.
# python manage.py startapp blog
# blog/
# models.py
# views.py
# admin.py
# apps.py
print('startapp scaffolds a feature module')Registering the App
Add your app to INSTALLED_APPS in settings.py so Django knows about it.
# settings.py
# INSTALLED_APPS = [
# 'django.contrib.admin',
# 'blog',
# ]
print('Register apps in INSTALLED_APPS')settings.py
settings.py holds all configuration: database, installed apps, allowed hosts, static files, and the secret key.
# Key settings:
# DATABASES, INSTALLED_APPS,
# ALLOWED_HOSTS, SECRET_KEY, DEBUG
print('settings.py centralizes config')The Dev Server
python manage.py runserver starts a local development server, by default at http://127.0.0.1:8000.
# python manage.py runserver
# -> Starting development server at
# http://127.0.0.1:8000/
print('runserver launches the dev server')URL Configuration
The project's urls.py is the root URL map. It usually include()s each app's own urls.
# mysite/urls.py
# from django.urls import path, include
# urlpatterns = [
# path('blog/', include('blog.urls')),
# ]
print('Project urls include app urls')Apps Are Reusable
Because an app is self-contained, you can drop the same app into multiple projects. This modular design is a core Django strength.
# A well-built 'blog' app can be reused
# across different Django projects
print('Apps promote reuse')Quick Check
Test your project structure knowledge.
Recap
You learned to structure a Django project.
- A project is the site; apps are reusable feature modules
startprojectandstartappscaffold them- Register apps in
INSTALLED_APPS manage.pyruns commands likerunserver- Project
urls.pyincludes each app's urls
Frequently asked questions
Is the “Projects and Apps” lesson free?
Yes — the full text of “Projects and Apps” is free to read here on the web, and the Python 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 Python Academy course, upgrade to CoddyKit PRO.
What will I learn in “Projects and Apps”?
Structure a Django project. You practise Python 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 Python Academy?
No prior experience is required. Python Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Projects and Apps” 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 Python Academy lesson?
Yes. Every Python 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
- Projects and Apps
- Models and Migrations
- Views and URLs
- The Django Admin