I help startups and teams build production-ready apps with Django, Flask, and FastAPI.
Let’s Talk →I'm always excited to take on new projects and collaborate with innovative minds.
No 7 Street E, Federal Low-cost Housing Estate, Kuje, Abuja 903101, Federal Capital Territory
New to Django? This beginner-friendly tutorial walks you step by step through setting up Django, creating your first project, and understanding the basics of Python web development.
If you’re looking to build web applications with Python, Django is one of the best frameworks to start with. It’s fast, secure, and comes with a lot of built-in features. In this beginner-friendly tutorial, we’ll walk through creating a simple Django app — a To-Do List.
Before we start, make sure you have the following installed:
Python 3.x
pip (Python package installer)
Virtualenv (optional but recommended)
Open your terminal and follow these steps:
# Create a project directorymkdir mytodocd mytodo
# Create a virtual environmentpython -m venv venvsource venv/bin/activate # On Windows: venv\Scripts\activate
# Install Djangopip install django
# Create a new Django projectdjango-admin startproject todo_project .
Run the server to test python manage.py runserverOpen http://127.0.0.1:8000 — you should see the Django welcome page.
Now let’s create a Django app inside our project.
python manage.py startapp todo
Add 'todo' to your INSTALLED_APPS in todo_project/settings.py:
INSTALLED_APPS = [ ... 'todo',]
In todo/models.py:
from django.db import models
class Task(models.Model): title = models.CharField(max_length=200) completed = models.BooleanField(default=False)
def __str__(self): return self.title
Then run:
python manage.py makemigrationspython manage.py migrate
In todo/admin.py:
from django.contrib import adminfrom .models import Task
admin.site.register(Task)
Create a superuser to access the admin:
python manage.py createsuperuser
Visit http://127.0.0.1:8000/admin and log in — you’ll see the Task model.
In todo/views.py:
from django.shortcuts import renderfrom .models import Task
def home(request): tasks = Task.objects.all() return render(request, 'todo/home.html', {'tasks': tasks})
Create a folder todo/templates/todo/ and add home.html:
<!DOCTYPE html><html><head> <title>To-Do List</title></head><body> <h1>My To-Do List</h1> <ul> {% for task in tasks %} <li> {{ task.title }} - {% if task.completed %}✔{% else %}✖{% endif %} </li> {% endfor %} </ul></body></html>
In todo/urls.py (create it if it doesn't exist):
from django.urls import pathfrom . import views
urlpatterns = [ path('', views.home, name='home'),]
Then in todo_project/urls.py, include the app's URLs:
from django.contrib import adminfrom django.urls import path, include
urlpatterns = [ path('admin/', admin.site.urls), path('', include('todo.urls')),]
Now run your server again:
python manage.py runserver
Visit http://127.0.0.1:8000 — you’ll see your To-Do list in action!
You’ve just created a simple Django app with:
A database model
Admin interface
Views and templates
URL routing
From here, you can add features like form submission, user authentication, and styling with Bootstrap or Tailwind CSS.
🧠 Want more tutorials like this? Let me know in the comments, or suggest your next project idea!
I'm Kingsley Odume, a Django, Flask, and FastAPI developer with experience building SaaS platforms, APIs, and modern web apps. If you're a recruiter or business owner looking for a reliable software developer, let's connect!
🚀 Hire MeYour email address will not be published. Required fields are marked *