← All tutorials

Getting started / 5 MIN READ

Install Django and start your first project

Create a virtual environment, install Django, and get a working project on your computer.

01 Create a workspace

These tutorials use Django 5.2 LTS and Python 3.10 or newer. Start in a new directory. The commands below use a macOS or Linux shell; on Windows, activate the environment with .venv\Scripts\activate instead.

Code example
mkdir django-notes
cd django-notes
python3 -m venv .venv
source .venv/bin/activate

02 Install Django

Keep dependencies inside the virtual environment. Pin the minor release so the examples use the same API, while allowing maintenance updates.

Code example
python -m pip install "Django>=5.2,<5.3"
python -m django --version

03 Create a project and one app

The config package holds project settings. The core app will contain our views, models, and templates. Add 'core' to INSTALLED_APPS in config/settings.py.

Code example
django-admin startproject config .
python manage.py startapp core
python manage.py migrate
python manage.py runserver

04 Check the result

Open http://127.0.0.1:8000/ in your browser. You should see Django's welcome page. Stop the development server with Ctrl+C. This server is intended for local development. Continue with the first-view tutorial to replace the welcome page.

Code example
python manage.py check
Keep exploring

Read the official Django documentation for details and more examples.