Part 2: Setting Up Your First Django Project
Source: Dev.to
This is Part 2 of the series “Learn Backend Development by Building a Social Media App.”
Welcome back! In the previous part you learned what a backend really is and how it quietly powers almost everything inside a modern app. Now it’s time to take the first real step: creating your backend project on your own computer.
By the end of this chapter you’ll have a running Django project on your machine. Seeing that browser window open for the first time with your backend responding is when the journey becomes real.
Understanding the Tools We’re About to Install
Python
Python is the language Django runs on. Think of it as the base ingredient in a recipe—without it, nothing works.
Django
Django is the framework that helps you create websites and backends quickly. It provides structure, tools, and many built‑in features.
Django REST Framework (DRF)
DRF is an add‑on for Django that helps you build APIs so your app (Android, iOS, Web) can talk to your backend easily.
We won’t install DRF today; we’ll start with Django first and add DRF in later parts.
What Happens When You Install Django?
When you install Django, your computer receives a toolbox filled with:
- tools to talk to databases
- tools to manage users
- tools to build URLs
- tools to create models
- tools to render data
- tools to validate information
- tools to structure your entire project
Django is like a well‑organized kitchen: everything has a purpose, and nothing is random.
Step 1: Install Python
If you already have Python 3.10 or above, you’re good. If not, download it from python.org.
Windows: make sure to check Add Python to PATH during installation.
After installation, open a terminal (Command Prompt, PowerShell, or macOS/Linux terminal) and run:
python --version
If it prints something like Python 3.10 or Python 3.11, you’re ready.
Step 2: Create a Project Folder
Choose a location for your backend project and create a folder, e.g.:
mkdir social_media_backend
cd social_media_backend
Open this folder in VS Code or your preferred editor.
Step 3: Create a Virtual Environment
A virtual environment is a private Python environment isolated from other projects.
Create it with:
python -m venv venv
Activate it:
-
Windows
venv\Scripts\activate -
macOS/Linux
source venv/bin/activate
You should see (venv) prefixed in your terminal prompt.
Step 4: Install Django
With the virtual environment active, install Django:
pip install django
Confirm the installation:
django-admin --version
A version number indicates success.
Step 5: Create Your Django Project
Run the following command inside social_media_backend:
django-admin startproject core .
django-admin– Django’s command‑line toolstartproject– creates a new projectcore– name of the project package.– creates the files in the current directory instead of a new sub‑folder
Project Structure
After the command, your directory will look like this:
social_media_backend/
│
├── core/
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ ├── asgi.py
│ └── wsgi.py
│
└── manage.py
Understanding the Django Project Structure
manage.py
The remote control for your project. Use it to start the server, apply migrations, create apps, and run custom commands.
settings.py
Configures everything Django does: database settings, installed apps, security, authentication, etc.
urls.py
Maps URLs to the code that should handle them.
asgi.py and wsgi.py
Connect your project to web servers. You won’t need to edit them yet, but they become important when deploying.
Step 6: Run Your Backend for the First Time
Start the development server:
python manage.py runserver
You’ll see output similar to:
Starting development server at http://127.0.0.1:8000/
Open a browser and visit http://127.0.0.1:8000/. You should see the Django welcome page.

This moment means your backend is alive—your journey as a backend developer has officially begun.
A Simple Diagram: Your Project Right Now

Everything you will build later—login, posts, notifications, stories—will start from this simple running server.
What’s Next in Part 3
Now that your project is created and running, the next step is understanding users. In Part 3 we’ll cover:
- How databases work
- What models are
- How Django stores data
- Designing a custom user model
- Registering a user
Stay tuned!