πŸš€ Day 1: Getting Started with Django – Beginner's Web Dev Series

Welcome to Day 1 of our 10-day Django Workshop! πŸŽ‰
If you’re new to Django and looking for a fast-track way to build secure, scalable web applications using Python, you’re in the right place.

In this post, we’ll cover the basics and help you create your first Django project and application β€” with hands-on coding. Let’s dive in.


πŸ“Œ What is Django?

Django is a high-level Python web framework that enables rapid development of secure and maintainable websites. It takes care of much of the hassle of web development so you can focus on writing your app without reinventing the wheel.

βœ… Built by developers, for developers
βœ… Follows the Model-View-Template (MVT) architecture
βœ… Includes built-in admin panel, authentication, ORM, routing, and more


πŸ’‘ Why Django?

  • ⚑ Fast Development: Less code, more productivity.

  • πŸ” Secure: Prevents common threats like CSRF, XSS, SQL Injection.

  • πŸ› οΈ Batteries Included: Comes with most things pre-built.

  • πŸ” DRY Principle: Don’t Repeat Yourself β€” write reusable, clean code.

  • 🌐 Scalable: Trusted by startups and large enterprises alike.


🌍 Who Uses Django?

Many tech giants and platforms started or still run on Django:

  • Instagram

  • Pinterest

  • Mozilla Firefox

  • Disqus

  • Bitbucket

  • Karobar

Django powers apps with millions of users β€” so yes, it’s production ready!


βš™οΈ Setting Up Django in 3 Steps

βœ… 1. Install Python (Skip if already installed)

Visit https://python.org and install Python 3.13.3.

βœ… 2. Create a Virtual Environment

python3 -m venv .venv
source .venv/bin/activate  # On Windows: env\Scripts\activate

βœ… 3. Install Django

pip install django

Confirm installation:

django-admin --version

πŸŽ‰ Done! Let’s build something real.


πŸ“ Creating Your First Django Project

Run this command in your terminal:

django-admin startproject mysite
cd mysite

This creates the following structure:

mysite/
β”œβ”€β”€ manage.py
└── mysite/
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ settings.py
    β”œβ”€β”€ urls.py
    β”œβ”€β”€ asgi.py
    └── wsgi.py

πŸ“ Understanding the folder structure

  • manage.py: Command-line utility to manage the project

  • __init__.py: Marks the folder as a Python package

  • settings.py: Configuration for the entire project

  • urls.py: Maps URLs to views and routes requests

  • wsgi.py: WSGI entry point used by servers (like Gunicorn or Django's dev server)

  • asgi.py: ASGI entry point for async servers (e.g., WebSockets)


🧱 Create Your First Django App

Inside your project folder:

python manage.py startapp homepage

Update settings.py to include the new app:

INSTALLED_APPS = [
    ...,
    'homepage',
]

Now you have a reusable app where you’ll build features.


🧠 What is a View in Django?

A view is a Python function that takes a web request and returns a web response.

Let’s create a simple view in homepage/views.py:

from django.http import HttpResponse

def index(request):
    return HttpResponse("Welcome to Django Workshop!")

πŸ”— Hooking Up URLs

Step 1: Create a new file homepage/urls.py:

from django.urls import path
from . import views

urlpatterns = [
    path('', views.index, name='index'),
]

Step 2: Connect it to the project-level mysite/urls.py:

from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('homepage.urls')),
]

🌐 Run Your Django Server

Fire up the dev server:

python manage.py runserver

Visit http://127.0.0.1:8000/ and you’ll see:

Welcome to Django Workshop!

You just built your first Django page πŸŽ‰


πŸ› οΈ Your Turn: Day 1 Challenge

Create your first Django project from scratch:

  • Project name: mywebsite

  • App name: homepage

  • Build a view that returns: "Day 1 challenge completed!"

  • Configure the app and route it correctly to show the message in the browser.


πŸ“š Coming Up Next…

Tomorrow we’ll cover:

  • Detailed url routing

  • Understanding Views(Function Based)

  • Introduction to Templates

  • Static files and Media files

2
Subscribe to my newsletter

Read articles from Shankar Lamichhane directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shankar Lamichhane
Shankar Lamichhane

Hi, I’m Shankar β€” a Sr. Software Engineer specializing in Python, Django, and DevOps. I build scalable web applications, APIs, and cloud-native systems, with a focus on clean architecture and backend automation.