Django Architecture: Models, Views and Templates

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. At its core, Django follows the MVT architecture: Model, View, and Template — which is similar in principle to the traditional MVC (Model-View-Controller) pattern. Side note, you can build your Django application using your desired architecture. Django doesn’t necessarily specify any particular form of architectural layering. This article is an extension of the previous post: https://me.chrisdevcode.com/posts/django-project-structure/ ...

July 1, 2025 · 3 min · Chris Achinga

Django Project Structure

Before we proceed, it’s important to understand how a typical Django project is structured. Django’s project structure is thoughtfully designed to make your code clean and maintainable. Whether building a simple blog or a complex web application, understanding this structure is critical for managing your project efficiently as it grows. Below, we’ll explore the key components of a typical Django project and how they work together. Assumptions This post will assume that you have your development already configured for Django/Python development. ...

June 30, 2025 · 3 min · Chris Achinga

Beginners Guide to Using APIs in Python

Application Programming Interfaces (APIs) are crucial in the world of software development. They serve as the backbone for communication between different software applications. This article explores how to interact with a simple API using Python. We’ll use a dummy server set up using JSON-Server, a package that allows you to create a fake API for testing and development purposes. Setting Up the Dummy Server Before diving into Python code, let’s set up our dummy server. JSON-Server provides a full fake REST API with zero coding in less than a minute(not literally). Here’s how you can set it up: ...

January 2, 2024 · 3 min · Chris Achinga

Deploying A Django Project on PythonAnywhere

Deploying a Django project on PythonAnywhere lets you make your web application accessible online. With PythonAnywhere, you can create a web app, configure it with a WSGI file, and host your Django project seamlessly. Prerequisites: Pythonanywhere Account An existing Django project is ready for deployment. GitHub (Code Repo) Basic Familiarity with Django and the command line interface For demo purposes, please refer to the following project: It’s a voting app from the official Django Tutorial ...

May 23, 2023 · 4 min · Chris Achinga

Reading Data From Files Using Python

Hi There! Welcome to Data 101. In this article, I will take you through reading files using Python as you prepare to analyze them. I will be using Google’s Colaboratory tool as my IDE. You don’t have to install or set up anything on your laptop/computer to use it, simply go to https://research.google.com/colaboratory/ and create a new notebook. Reading CSV Files You’ll need to upload a data file. To do so, click on the folder icon on the far left of the Notebook: ...

October 5, 2021 · 2 min · Chris Achinga

Running The Django App

If you are coding along, I used the following set up environment: Requirement: Python3 Virtualenv Pip The file structure of the cloned project is as shown below: ├── manage.py ├── myapp │ ├── admin.py │ ├── apps.py │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── tests.py │ └── views.py └── _projectroot ├── asgi.py ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-38.pyc │ ├── settings.cpython-38.pyc │ ├── urls.cpython-38.pyc │ └── wsgi.cpython-38.pyc ├── settings.py ├── urls.py └── wsgi.py Registering a Django application For an application to be functional, we have to let Django know that it exists. ...

February 22, 2021 · 5 min · Chris Achinga

Starting a Django Project

Create a specific directory top work on. cd django-template You’ll notice some folders created and a pyvenv.cfg file created but we won’t need it at all. Activate the virtual environment source bin/activate Installing Django I’m going to use the latest official version (3.0.8), using the simple command below: pip3 install django Confirm if it’s installed by checking the version python3 -m django --version Creating A Django Project Starting a Django project ...

February 21, 2021 · 2 min · Chris Achinga

Starting a Django Project

What Is Django Django is a python web framework. It’s used to developing full-stack web applications. Django is my to-go framework before considering other options when it comes to working with full-stack projects, either personal or commercial. Well, there are other options to use like Express which is a great stack too. What Should I know before using Django Django is a python framework, so this goes without saying that you need to know some bit of python basics and syntax before hitting the road. But as some prefer, learning as you go, Django does give too many constraints with the option too. ...

February 18, 2021 · 11 min · Chris Achinga