Digital Marketing
Digital Marketing for Beginners: How to Grow Your Business Online (Complete Guide)
Apr 25, 2026
Building a website from scratch might seem overwhelming, but with Django, one of the most powerful Python web frameworks, you can create secure, scalable, and professional web applications faster than you think.
In this step-by-step guide, you’ll learn how to build a Django website from scratch—even if you're just getting started.
Django is a high-level Python web framework that allows developers to build web applications quickly and securely. It comes with built-in features like authentication, admin panel, and database management.
Make sure you have:
First, install Django using pip:
pip install django
Check if it’s installed:
django-admin --version
Run the following command:
django-admin startproject mywebsite
Navigate into the project folder:
cd mywebsite
Start the development server:
python manage.py runserver
Open your browser and go to:
http://127.0.0.1:8000/
A Django project can have multiple apps. Create one:
python manage.py startapp main
Register the app in settings.py:
INSTALLED_APPS = [
'main',
]
In main/views.py:
from django.http import HttpResponse
def home(request):
return HttpResponse("Welcome to my Django website!")
Create a urls.py file inside the app and add:
from django.urls import path
from .views import home
urlpatterns = [
path('', home, name='home'),
]
Now link it in the main project urls.py:
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('', include('main.urls')),
path('admin/', admin.site.urls),
]
Create a templates folder inside your app and add home.html:
<!DOCTYPE html>
<html>
<head>
<title>My Django Website</title>
</head>
<body>
<h1>Welcome to My Website</h1>
</body>
</html>
Update your view:
from django.shortcuts import render
def home(request):
return render(request, 'home.html')
Create a static folder and add your CSS/JS files.
Update settings.py:
STATIC_URL = '/static/'
Load static files in HTML:
{% load static %}
<link rel="stylesheet" href="{% static 'style.css' %}">
Run migrations:
python manage.py migrate
Create a model in models.py:
from django.db import models
class Post(models.Model):
title = models.CharField(max_length=200)
content = models.TextField()
Apply migrations:
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
Access admin panel:
http://127.0.0.1:8000/admin/
Once your site is ready, deploy it using:
/blog/how-to-build-django-site)Building a Django website from scratch is one of the best ways to learn web development and create powerful applications. With Django’s built-in features and scalability, you can build anything from simple blogs to complex platforms.
Start small, stay consistent, and keep improving your projects.
If you want a fast, secure, and SEO-optimized website, Amasoft Ghana can help you build and grow your online presence.
Contact me today and take your business to the next level.