Your First Project
With Django installed inside our activated taskflow-env virtual environment, it's
time to actually create the TaskFlow project. This lesson walks through the whole path from an
empty folder to a running development server, and clears up a distinction that confuses a lot of
newcomers: the difference between a Django project and a Django app.
Creating the Project
Django installs a command-line tool called django-admin that can scaffold a new
project for you. From inside your TaskFlow folder, with the virtual environment activated, run:
django-admin startproject taskflow_project .
Two details in that command matter a lot:
taskflow_projectis the name we're giving the project's configuration package — it can be almost anything, but should be descriptive and avoid clashing with Django's own module names.- The trailing dot (
.) tellsstartprojectto create the project directly inside the current folder, instead of creating a new nested subfolder first.
django-admin startproject taskflow_project creates a new folder named
taskflow_project, and inside that another folder also named
taskflow_project plus manage.py — a confusing extra layer of
nesting. Adding the dot places manage.py directly in your current working folder,
with the configuration package one level below it, which is the layout most real projects (and
deployment tools) expect.
Project vs. App: A Crucial Distinction
Django draws a sharp line between two concepts that a lot of other frameworks blur together:
- A project is the overall container: site-wide settings, the root URL configuration, and the list of installed apps. TaskFlow's project is
taskflow_project, and there's exactly one of it. - An app is a self-contained module that implements one feature area — task management, user accounts, billing, and so on. A single project can (and often does) contain several apps.
Right now, after running startproject, TaskFlow has a project but zero apps yet. We
haven't written any task-management logic at all — we've only created the container that
will eventually hold it. We'll create TaskFlow's first actual app, appropriately named
taskflow, in the very next lesson.
Running the Development Server
Even with no apps yet, the freshly created project is already a runnable Django site. From the
folder containing manage.py, start the built-in development server:
python manage.py runserver
This starts a lightweight web server, by default listening on
http://127.0.0.1:8000/. Opening that address in a browser shows Django's default
success page — a rocket graphic confirming the installation worked and the project is
wired up correctly. Seeing that page is your checkpoint that everything so far — the
virtual environment, the Django install, and the new project — is in good shape before we
add any TaskFlow-specific code.
What manage.py Actually Is
manage.py is a small script that startproject generates for you, and
it's worth understanding what it does rather than treating it as magic. Underneath, it's a thin
wrapper around Django's command-line utilities, pre-configured to know which settings module
belongs to this specific project — that's why running python manage.py
runserver from inside the TaskFlow folder always operates on the TaskFlow project, using
TaskFlow's own settings, database, and installed apps.
Every command you'll run throughout this track — starting apps, creating migrations,
opening the interactive shell, creating an admin user — goes through this same
manage.py entry point.
A Full Walkthrough, Start to Finish
Putting the whole sequence together, here's the complete path from an empty folder to a running TaskFlow project:
mkdir taskflow
cd taskflow
python -m venv taskflow-env
taskflow-env\Scripts\activate.bat
pip install django
django-admin startproject taskflow_project .
python manage.py runserver
(Swap the activation line for source taskflow-env/bin/activate on Mac/Linux, as
covered in the previous lesson.) At the end of this sequence, visiting
http://127.0.0.1:8000/ should show Django's success page, and you're ready to start
building TaskFlow's actual features.
startproject generated and what each file is responsible for.