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

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

Building Progressive Web Apps in Angular (using pwafire)

Progressive Web Apps(PWA) are basically sites that use modern web tools to provide app-like experiences to users. https://web.dev/explore/progressive-web-apps Progressive Web Apps (PWA) are built and enhanced with modern APIs to deliver enhanced capabilities, reliability, and installability while reaching anyone, anywhere, on any device with a single codebase: https://web.dev/articles/what-are-pwas PWAs is a very interesting topic when it comes to user experiences and why businesses would use it. It comes down to users needs and organization goals and agenda, but hear me out: ...

December 12, 2023 · 5 min · Chris Achinga

Creating an installable Next.Js Application

Next.js, a React framework for server-side rendering, provides a solid foundation for creating fast and efficient web applications. In this article, we will explore the process of creating an installable Next.js application, taking advantage of the PWA features offered by modern browsers. What is a Progressive Web Application (PWA)? A Progressive Web Application is a web application that utilizes modern web capabilities to deliver an app-like experience to users. PWAs are built with web technologies such as HTML, CSS, and JavaScript and can be accessed through a browser without installing an app store. PWAs offer several advantages, including offline functionality, push notifications, and the ability to be added to the user’s home screen for quick access. ...

June 25, 2023 · 5 min · Chris Achinga

How to Fetch Data from an API in Angular

The Dad Jokes App: Spreading Laughter One Click at a Time Humor has a unique way of brightening up our day and creating moments of joy. In the digital age, countless apps cater to various interests, and one app that stands out is the Dad Jokes App. This lighthearted application brings a collection of witty and groan-inducing dad jokes to your fingertips, ensuring laughter is just a click away. In this article, we’ll explore the features and development of the Dad Jokes App and its impact on users’ daily lives. ...

May 29, 2023 · 5 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

Building a Weather and Time Telegram Bot using Node.js

Telegram bots are automated applications that run inside Telegram. Users can interact with bots by sending messages, commands, and inline requests. Today, we’ll walk you through how to build a simple Telegram bot using Node.js that provides weather and time information for any city. Prerequisites Before we start, make sure you have the following: Node.js and npm are installed on your machine. A Telegram account to create and manage bots. An API key from OpenWeatherMap. Setting Up Your Project Firstly, install the required Node.js packages: dotenv, node-telegram-bot-api, axios, and moment-timezone. ...

May 15, 2023 · 4 min · Chris Achinga

Building Scalable, Secure, and Feature-Rich Apps with Appwrite: A Technical Overview

Appwrite is an open-source, end-to-end Backend-as-a-Service (BaaS) platform designed to simplify the process of building web and mobile applications. %[https://appwrite.io/] Core Components of Appwrite User Authentication and Management Appwrite offers built-in user authentication and management services, supporting multiple authentication methods such as email and password, OAuth2 providers (e.g., Google, Facebook), and more. It also provides APIs for user registration, login, password recovery, and session management. This simplifies the implementation of secure user management in your app. ...

March 24, 2023 · 5 min · Chris Achinga

Building a GraphQL API with NodeJS: A Step-by-Step Guide

GraphQL is a powerful query language for APIs that allows developers to request and receive the data they need efficiently. In this step-by-step guide, we will walk you through the process of building a GraphQL API using Node.js, using airport data as a sample for the demo. Whether you’re a beginner or an experienced developer, this tutorial will provide you with the necessary knowledge to easily create your GraphQL API. ...

March 6, 2023 · 3 min · Chris Achinga

How To Convert HTML templates to NextJS (v13)

Now that Next.JS is an awesome frontend tool. How can we get HTML/CSS/JS Templates to work perfectly in a Next.JS project? This article will take you through the steps. Requirements To fully grasp the content, it’s highly recommended that you have the following tools installed on your development environment: NodeJS Text Editor (Maybe VIM?) Basic React.js and Next.JS knowledge Finding a Template For the demo, we will use one of the open-sourced templates from Startbootstrap. We will use the Freelancer theme, a perfect template for a personal portfolio website. ...

February 22, 2023 · 4 min · Chris Achinga

Unlocking the Power of Headless CMS for Seamless Content Delivery

A headless content management system (CMS) is a back-end-only content management system (CMS) built from the ground up as a content repository that makes content accessible via an API for display on any device. In this article, we will explore the benefits of headless CMS and how it can unlock the full potential of your content delivery strategy. Before we list out examples, let’s see what makes Headless CMS has to offer; ...

February 1, 2023 · 5 min · Chris Achinga

Developer Communities In Kenya

2022 has seen growth in Developer communities and Tech events in Kenya. There are now many communities that developers can benefit from just by being a part of. This article will list some of them and how to join the communities. Only Devs Only Devs is a developer Community from Mombasa. It started from a Payment Integration Hackathon, and they have been active ever since. They have weekly sessions on Fridays at Techbridge Invest, where they share skills and knowledge and hold hands-on code sessions. ...

January 12, 2023 · 2 min · Chris Achinga

My 2022: Setting my Pace!

2022 was a great year for my career and personal growth. I had my most “first times,” and memorable moments were made. Here is a sneak peek into my 2022: Career Growth Technical Writing I started getting money from writing articles in February 2022. It’s something I had not planned for at all. A friend of mine, who we used to co-manage a developer community, Meta Developer Circles, referred me to Hackmamba as a Technical writer. ...

January 5, 2023 · 3 min · Chris Achinga

How to Test APIs on Mobile using API Tester

Imagine testing APIs using your mobile device, either iPhone or Android. All APIs, including REST, GraphQL, WebSocket, SOAP, JSON RPC, XML, HTTP, and HTTPS. This article will show how we can test APIs on mobile devices using API TESTER. Prerequisites API TESTER Mobile Application Ready to Use API endpoints The API TESTER application is freely available for the following devices: iOS: Download Link Android: Download Link Huawei: Download Link This article will use demo API endpoints from JSONPlaceholder, which offers free fake REST API. ...

November 29, 2022 · 3 min · Chris Achinga

How to configure Bootstrap SCSS and JS into a NextJS Project

Bootstrap is one of the simplest and most used CSS libraries. This article will guide you on configuring a NextJs project with Bootstrap SCSS and JS files. Codesandbox Demo %[https://codesandbox.io/p/github/achingachris/next-bootstrap-template/draft/zealous-archimedes] GitHub: %[https://github.com/achingachris/next-bootstrap-template/tree/config-bootstrap-scss-and-js] Creating a Next.js Project If you already have a NextJS project, skip to the next step. On a terminal, run the following script to set up a NextJs project: npx create-next-app@latest After installation, run: npm run dev A successful setup will run on localhost:3000. ...

November 15, 2022 · 3 min · Chris Achinga