Create First Project

Use django-admin startproject to generate a new project. Learn what each generated file does and run initial checks to ensure everything is wired correctly.

1. Introduction

In this guide we will create our first Django project using the django-admin command. This generates a ready-to-use folder structure with the config files Django needs to run.

  • Python 3.11 must be installed. If not, see Install Python.
  • Your .venv must be active. If not, see Setup venv.
  • Django 5.2 must be installed inside the environment. If not, see Install Django.

2. The django-admin command

When you install Django, it adds a command line tool called django-admin to your environment. You use it once to create a new project. After that, you use manage.py for everything else.

The command to create a project is:

django-admin startproject projectname

3. Create the project

Make sure your .venv is active, then navigate to the folder where you want to keep your project. Run the following command:

django-admin startproject mysite .

Notice the dot . at the end. It tells Django to create the project files inside the current folder instead of creating an extra nested folder. This keeps your project layout clean.

Without the dot, Django would create a folder called mysite containing another folder called mysite — which works but is harder to navigate.

4. What was generated

After running the command, your project folder will look like this:

myproject/
├── .venv/
├── manage.py
├── requirements.txt
└── mysite/
    ├── __init__.py
    ├── settings.py
    ├── urls.py
    ├── asgi.py
    └── wsgi.py

Here is what each file does:

  • manage.py — a command line tool for running your project. You will use this every day: to start the server, run migrations, create apps, and more. Do not edit this file.
  • mysite/ — the inner folder is your project's Python package. It has the same name as the project you created.
  • mysite/__init__.py — an empty file that tells Python this folder is a package. Do not edit this file.
  • mysite/settings.py — all your project configuration lives here: database, installed apps, static files, timezone, and more. You will edit this file often.
  • mysite/urls.py — the main URL configuration file. It maps URLs to views. Think of it as the table of contents for your project's routes.
  • mysite/asgi.py — entry point for ASGI-compatible web servers. Used for async and real-time features. Leave it for now.
  • mysite/wsgi.py — entry point for WSGI-compatible web servers. Used when deploying to production. Leave it for now.

5. Run an initial check

Django includes a built-in system check that scans your project for common problems. Run it now to confirm everything is wired correctly:

python manage.py check

If the setup is correct you will see:

System check identified no issues (0 silenced).

If you see errors at this point, the most common cause is that your .venv is not active or Django was not installed correctly. Recheck both and try again.

6. Project vs app — what is the difference

In Django, a project is the whole website. It holds the settings, URL config, and ties everything together. A app is a single feature or component inside that project — for example a blog, a shop, or a user profile section.

  • One project can contain many apps.
  • Apps are meant to be self-contained and reusable.
  • You just created the project. We will create the first app two steps from now.

7. Next steps

Your Django project is created and verified. The next step is a quick tour of the project structure so you understand what each file and folder does before we start building.


Never miss a story on Django.wiki

Subscribe for fresh tutorials, snippets, and updates.

By subscribing you agree to our Privacy Policy.