django

Week 2 – Creating Simple Blog App

Week 2 – Creating Simple Blog App

Introduction Welcome back to my journey of building a blog app using Django without using ChatGPT. This week, I focused on implementing key features to enhance my blog app. I added a functionality that allow users to create posts, comment on posts, and like other user's posts. Here's a detailed breakdown of what I did: Create Django posts app python manage.py startapp posts Enter fullscreen mode Exit fullscreen mode Designing the Post Model I started by designing the Post model. This model will store the blog posts created by users: from django.db import models from django.contrib.auth.models import User from django.utils…
Read More
Defining tasks, brokers, workers, and backends in Celery

Defining tasks, brokers, workers, and backends in Celery

Celery can be daunting to learn. While its documentation is comprehensive, it has a tendency to skip the basics. This post will define four of the main concepts in Celery, discuss the relationship between Celery and Kombu, and use a few code examples to illustrate how Celery might be useful in real applications. The examples will use the Django web framework and its @shared_task decorator, but the concepts are also applicable to Flask, FastAPI, and others. Tasks, Brokers, Workers, and Backends You'll be hard pressed to find a place on the current Celery documentation that clearly spells out what it…
Read More
Build a Dynamic Photo Collection App With Django

Build a Dynamic Photo Collection App With Django

Creating a dynamic photo collection app that spans different industries is an exciting opportunity in web development. These apps, also known as lookbooks, can be used in fields like fashion, real estate, and travel to showcase visual content effectively. Recently, I developed a comprehensive lookbook using Django and Cloudinary. You can get a thorough understanding of its functionalities by watching a video walkthrough and reading a detailed description. Additionally, we'll highlight some noteworthy features that developers may find intriguing. Tip: You can fork the app from GitHub to explore its capabilities firsthand and sign up for a free Cloudinary account…
Read More
How to customize the User model in Django?

How to customize the User model in Django?

Image credits to: Pin In this post I explain three methods to extend or customize Django’s User model, without having to rewrite it from scratch, and keeping all Django’s user management features But, before we start, let’s see where Django’s User model comes from. Where does the Django User model come from? Django’s User model inherits from AbstractUser which, in turn, inherits from the AbstractBaseUser class. graph TD; AbstractBaseUser-->AbstractUser; AbstractUser-->User; If you look at the Django source code, you will see that the User model you normally use has virtually no functionality of its own , but inherits all of…
Read More
How to improve Django Framework?

How to improve Django Framework?

On June 21, 2024 I started a thread on reddit with the following question: “What would you improve about Django framework?”. The response from the community was immediate and the conversation quickly filled up with suggestions on how to improve Django framework, ranging from modest to quite radical. I summarize the results below. HTMX meme Would type hints improve Django Framework? This was the comment that received the most support from the community. Although Python already has optional Type Hints since version 3.5, it seems that implementing them for the purpose of modernizing Django Framework does not seem to be…
Read More
Django Basics: A Comprehensive Guide

Django Basics: A Comprehensive Guide

Django is a Python web framework for fast development and clean design. This guide covers the Django app structure, models, views, templates, and URL configuration. It is structured to help you build your understanding incrementally, enabling you to work efficiently with Django. By the end of the guide, you will have a comprehensive understanding of Django's core components, empowering you to build robust web applications. Django App Structure A Django app is a self-contained module that delivers a specific functionality for your web project. You can reuse apps in different projects, making them modular and flexible. Examples of Django apps…
Read More
Introducing Django Headless CMS: A Powerful and Flexible CMS Solution

Introducing Django Headless CMS: A Powerful and Flexible CMS Solution

Introduction Are you looking for an effortless way to create and manage a headless CMS? Look no further! I'm excited to introduce Django Headless CMS, a robust, open-source content management system designed to simplify the process of managing and delivering content across multiple platforms. Built on Django, this package leverages the sturdy foundation of the Django framework while providing a headless approach, making it ideal for modern web applications. Why Choose Django Headless CMS? Why choose Django-headless-cms over alternatives like Wagtail, Django-CMS, Strapi, or Contentful? Headless CMS with minimal configuration: Unlike Wagtail and Django-CMS, which are primarily headed CMS solutions.…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.