DjangoCon Africa, My Expectations

The wait is almost over(that’s if you’re reading this before Aug 11th, 2025). This is the second DjangoCon Africa I will be attending, the first one was a few years ago, and I wrote about it here: https://me.chrisdevcode.com/posts/djangocon-africa-2023-a-year-later/ A lot has happened ever since, got to learn about stuff(LOL) about how Django and the DSF. I cannot wait for this year’s edition. You can also checkout the official DjangoCon Africa 2023 report: https://2023.djangocon.africa/news/report/ ...

August 3, 2025 · 3 min · Chris Achinga

Django Models

From my past post: https://me.chrisdevcode.com/posts/django-architecture-models-views-templates/ In Django, a model is what defines your database table. It’s basically a python class that maps to a single table in your database. For example, class Users will simply be the Users table: class Users(models.Model): full_name = models.CharField(max_length=200) bio = models.TextField() def __str__(self): return self.full_name Django’s documentation on models: https://docs.djangoproject.com/en/5.2/topics/db/models/ In Django, a model is a special type of object that represents and stores data in the database. A database is simply a structured collection of data — where you keep information such as users, blog posts, and more. ...

July 2, 2025 · 2 min · Chris Achinga

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

DjangoCon Africa 2023, Almost a Year Later …

The Announcement I only saw Django Conferences happening in European and American countries. From the content and updates shared on X and by speakers/attendees, I realized that these events had serious content to share. I envied that. This right here, the X(tweet 😂) on May 10th. Hello World 👋🏼 We are more than excited to announce the first-ever DjangoCon event in Africa. It will take place this year in Zanzibar, Tanzania, from 6th - 11th November 2023! Please visit https://t.co/qC69TfKnPt to learn more! 1/3 🧵#djangoconAfrica #djcafrica #djangocon pic.twitter.com/gypAJD07hX ...

July 10, 2024 · 4 min · Chris Achinga

Seeding Data in Django Using Faker

Seeding data in a Django project can be essential for development and testing. Faker, a Python library, provides a convenient way to generate placeholder data realistically. This guide will explore how to seed data using Faker in Django. Here is an example model: First, let’s consider an example model consisting of Skill and Category. from django.db import models import uuid class Skill(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, unique=True) title = models.CharField(max_length=200, unique=True) def __str__(self): return self.title class Category(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, unique=True) title = models.CharField(max_length=200, unique=True) def __str__(self): return self.title Creating a Seeder Command To seed data easily, we’ll create a custom management command. ...

March 27, 2024 · 2 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

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