Django·Django from project to API

Setup and project structure

Create a virtual environment, start a project and understand apps.

Intermediate 12 min read Lesson 1 of 300 Challenge included
What you will be able to do
  • Use a virtual environment per project.
  • Create a project with django-admin startproject.
  • Create apps with manage.py startapp.
  • Keep secrets in environment variables.

In plain English

A Django project is a container for settings and URLs; an app is a reusable feature. Keep each app focused. Start with a virtual environment so dependencies stay reproducible.

terminalTerminal
python -m venv .venv
source .venv/bin/activate
pip install django
django-admin startproject config .
python manage.py startapp lessons
Your turn

Create an app

Easy

Write the command that creates a Django app named courses.

BASH · starter
python manage.py
Check your understanding before moving on.
Knowledge checkQuestion 1

What is the difference between a project and an app?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Views and URLs
Lesson 1 of 300 · 0% of course