<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chemutai Brenda</title>
    <description>The latest articles on DEV Community by Chemutai Brenda (@chenda001).</description>
    <link>https://dev.to/chenda001</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3290035%2F21ef387c-1a9e-48e0-8338-4d8dec65e666.jpg</url>
      <title>DEV Community: Chemutai Brenda</title>
      <link>https://dev.to/chenda001</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chenda001"/>
    <language>en</language>
    <item>
      <title>Day 5: Django Architecture: Models, Views and Templates.</title>
      <dc:creator>Chemutai Brenda</dc:creator>
      <pubDate>Tue, 08 Jul 2025 13:36:42 +0000</pubDate>
      <link>https://dev.to/chenda001/day-5-connecting-everything-with-djangos-mvt-architecture-3e64</link>
      <guid>https://dev.to/chenda001/day-5-connecting-everything-with-djangos-mvt-architecture-3e64</guid>
      <description>&lt;h1&gt;
  
  
  python  #learning  #frontend  #development
&lt;/h1&gt;

&lt;p&gt;Today I focused on understanding and applying Django’s MVT(Model View Template) architecture, (model, views and templates) the foundation of how Django apps work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;## MODEL – Data layer.&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;So what is a Model in Django?&lt;/strong&gt;&lt;br&gt;
I understood Model as a Python class used to define the structure of your database.&lt;/p&gt;

&lt;p&gt;Django uses it to create tables automatically, based on your field definitions.&lt;/p&gt;

&lt;p&gt;It handles all data-related operations: Create, Read, Update, Delete (CRUD). For example in my previous project I added this kind of model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.db import models

class Item(models.Model):
    name = models.CharField(max_length=100)
    description = models.TextField()
    created_at = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;u&gt;## VIEW – Logic Layer&lt;/u&gt;&lt;br&gt;
What is a View in Django?&lt;/strong&gt;&lt;br&gt;
A View is a Python function (or class) that handles the logic behind a page.&lt;/p&gt;

&lt;p&gt;It receives a request, fetches data (usually from the Model), and returns a response (usually a rendered Template).&lt;/p&gt;

&lt;p&gt;I created a view to fetch data from the database and send them to the template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.shortcuts import render

def home(request):
    return render(request, 'app1/home.html')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;u&gt;## TEMPLATE– Presentation Layer&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
You are probably wondering &lt;strong&gt;what is a Template in Django?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Template is an HTML file used to display content to the user.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It uses Django’s built-in Template Language (DTL) to display variables, loop through data, and include logic.&lt;br&gt;
So in both apps I used the the templates as in the previous article.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- blog/templates/blog/post_list.html --&amp;gt;

&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;My Users&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;All Users&amp;lt;/h1&amp;gt;
    {% for user in users %}
        &amp;lt;div&amp;gt;
            &amp;lt;h2&amp;gt;{{ user.full_name }}&amp;lt;/h2&amp;gt;
            &amp;lt;p&amp;gt;{{ user.bio }}&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
    {% empty %}
        &amp;lt;p&amp;gt;No USers available.&amp;lt;/p&amp;gt;
    {% endfor %}
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;&lt;strong&gt;## URL – Routing Layer&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;
&lt;strong&gt;what are URLs in Django?&lt;/strong&gt;&lt;br&gt;
The URL configuration connects user requests (like &lt;a href="http://localhost/products" rel="noopener noreferrer"&gt;http://localhost/products&lt;/a&gt;) to the correct view.&lt;/p&gt;

&lt;p&gt;URLs act like a bridge between the browser and the backend logic.&lt;br&gt;
Then I used my URLs in my previous article.&lt;br&gt;
URL configuration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.urls import path
from . import views

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

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  HOW IT ALL CONNECTS (MVT FLOW):
&lt;/h2&gt;

&lt;p&gt;User types &lt;a href="http://localhost:8000/products/" rel="noopener noreferrer"&gt;http://localhost:8000/products/&lt;/a&gt; URL routes it to views.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;View calls the Product model View&lt;/li&gt;
&lt;li&gt;Model fetches data from the database Model&lt;/li&gt;
&lt;li&gt;View passes data to the template View&lt;/li&gt;
&lt;li&gt;Template displays data in HTML Template&lt;/li&gt;
&lt;li&gt;Summary of Each Part&lt;/li&gt;
&lt;li&gt;Part Django File Purpose&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;View&lt;/strong&gt;- views.py Contains logic to fetch/process data&lt;br&gt;
&lt;strong&gt;Template&lt;/strong&gt; templates/.html Displays data using HTML &amp;amp; DTL&lt;br&gt;
&lt;strong&gt;URL&lt;/strong&gt;- urls.py Connects browser requests to views.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
Using the MVT architecture separates concerns cleanly:&lt;br&gt;
• Model:&lt;br&gt;
Defines your data. &lt;br&gt;
Defines structure of database tables&lt;/p&gt;

&lt;p&gt;• View: &lt;br&gt;
Handles logic and retrieves data.&lt;br&gt;
Contains logic to fetch/process data&lt;/p&gt;

&lt;p&gt;• Template: &lt;br&gt;
Renders the output.&lt;br&gt;
Displays data using HTML &amp;amp; DTL&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;URLS 
Connects browser requests to views.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure helps you write clean, maintainable code and scale your project efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Reflection on Day 5
&lt;/h2&gt;

&lt;p&gt;Understanding how each MVT part plays its role helped me finally see Django as a full web framework — not just scattered files. Now I can create real, working web pages powered by Python and databases, not just static HTML.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>DAY 4 OF LEARNING DJANGO.</title>
      <dc:creator>Chemutai Brenda</dc:creator>
      <pubDate>Mon, 30 Jun 2025 16:26:50 +0000</pubDate>
      <link>https://dev.to/chenda001/day-4-of-learning-django-31c</link>
      <guid>https://dev.to/chenda001/day-4-of-learning-django-31c</guid>
      <description>&lt;p&gt;&lt;strong&gt;DJANGO STRUCTURE.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Today i learnt how to do a set for creating a project using Django.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Set up&lt;/u&gt;&lt;br&gt;
Creating a programming environment&lt;br&gt;
I open a folder in my installed text editor(VS Code) and runed the following command in the terminal to create an environment called env.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  python -m venv env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the terminal, I used the following command to activate the environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.env/Scripts/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 2:&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Installing Django&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;I used the following command in the newly created environment to install Django.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install django
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 3:&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Starting my project.&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;To start my project i run the following command in the vs code terminal to generate root directory with project name, which in this case is called "MyProject".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;django-admin startproject myproject

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 4:&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;The Project Wide Settings.&lt;/u&gt;&lt;br&gt;
After creating MyProject root directory, there is another directory called MyProject, just as the project name.&lt;br&gt;
This other directory contains the project-wide settings and configurations as shown below in a diagram:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F02r3mthk0ryi3u7a3div.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F02r3mthk0ryi3u7a3div.png" alt="Image description" width="147" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;init.py:&lt;br&gt;
 A file that tells Python that all files in the directory should be considered a Python package.&lt;br&gt;
Without this file, we cannot import files from another directory which we will be doing a lot of in Django and project creation.&lt;/p&gt;

&lt;p&gt;settings.py:&lt;br&gt;
 Contains all the project’s settings and configurations.&lt;br&gt;
Inside the settings I change the time from 'UTC' to 'Africa, Nairobi'.&lt;/p&gt;

&lt;p&gt;urls.py:&lt;br&gt;
 The URL declarations for the project are a “table of contents” of your Django-powered site.&lt;/p&gt;

&lt;p&gt;asgi.py:&lt;br&gt;
 allows for an optional Asynchronous Server Gateway Interface(ASGI) to be run&lt;/p&gt;

&lt;p&gt;wsgi.py:&lt;br&gt;
 An entry point for Web Server Gateway Interface(WSGI) compatible web servers to serve your project. It helps Django serve our eventual web pages&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;STEP 5:&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Applications.&lt;/u&gt;&lt;br&gt;
-Django can be used to create multiple apps where each app is a Python package that follows a certain convention. In this case I created two apps called app1 and app2 respectively.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I run the following command from terminal to create app1:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;manage.py startapp app1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;I run the following command from terminal to create app2:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;manage.py startapp app2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvgf460j0dk0zry3rvmel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvgf460j0dk0zry3rvmel.png" alt="Image description" width="167" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the two apps each app came with important files like;
&amp;gt; admin.py:
Configuration for the Django admin interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;apps.py: &lt;br&gt;
Configuration for the app itself.&lt;/p&gt;

&lt;p&gt;models.py:&lt;br&gt;
 Contains the database models for the app.&lt;/p&gt;

&lt;p&gt;tests.py: &lt;br&gt;
Contains tests for the app.&lt;/p&gt;

&lt;p&gt;views.py:&lt;br&gt;
 Contains the request/response logic for the app.&lt;/p&gt;

&lt;p&gt;migrations/:&lt;br&gt;
 Contains database migrations for the app&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;STEP 5:&lt;/strong&gt;&lt;br&gt;
To make Django recognize both apps, I opened mysite/settings.py and added them in INSTALLED_APPS&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1pj6jf81fmom1jsouhz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1pj6jf81fmom1jsouhz.png" alt="Image description" width="352" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 6:&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Creating URLS and Writing views:&lt;/u&gt;&lt;br&gt;
For app1&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In app1/views.py i created this code;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.shortcuts import render

def app1_home(request):
    return render(request, 'app1_home.html')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;I then created urls.py for app1 added the following in it
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.urls import path
from .views import app1_home

urlpatterns = [
    path('', app1_home, name='app1_home'),
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;For app2&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In app2/views.py:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.shortcuts import render

def app2_home(request):
    return render(request, 'app2_home.html')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then I created app2/urls.py:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.urls import path
from .views import app2_home

urlpatterns = [
    path('', app2_home, name='app2_home'),
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 7&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Connecting Both Apps in mysite/urls.py&lt;/u&gt;&lt;br&gt;
Now it was time to connect both apps to the main URL configuration.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In mysite/urls.py I wrote:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.contrib import admin
from django.urls import path, include

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

urlpatterns = [
    path('admin/', admin.site.urls),
    path('app1/', include('app1.urls')),
    path('app2/', include('app2.urls')),
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhy616o6c2o5cmig6ft8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhy616o6c2o5cmig6ft8.png" alt="Image description" width="739" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 7:&lt;/strong&gt;&lt;br&gt;
&lt;u&gt;Adding pages for HTML Pages&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Templates(what users see, HTML and CSS) are typically stored in a 'templates' directory within each app or in a project-wide templates directory.&lt;br&gt;
So I created a templates folder inside each app&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In both app1 and app2, I made this folder structure:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For app1:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app1/
└── templates/
    └── app1/
        └── home.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For app2:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app2/
└── templates/
    └── app2/
        └── home.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 8:&lt;/strong&gt;&lt;br&gt;
Updating views to render templates&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In app1/views.py:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.shortcuts import render

def home(request):
    return render(request, 'app1/home.html')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In app2/views.py:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`from django.shortcuts import render

def home(request):
    return render(request, 'app2/home.html')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this I was able to learn how to set up a Django structure for creating a project. I also managed to understand how two or more apps can be created inside one project.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>DAY 3 OF LEARNING DJANGO.</title>
      <dc:creator>Chemutai Brenda</dc:creator>
      <pubDate>Thu, 26 Jun 2025 12:25:07 +0000</pubDate>
      <link>https://dev.to/chenda001/d3-of-learning-django-5d4c</link>
      <guid>https://dev.to/chenda001/d3-of-learning-django-5d4c</guid>
      <description>&lt;p&gt;Today i learnt about python data types:&lt;br&gt;
&lt;strong&gt;1. Text Type.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;str (string) used to incorporate texts in a code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;name = "Chenda"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;2. Numerical types&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;int → Whole numbers&lt;/li&gt;
&lt;li&gt;float → Decimal numbers&lt;/li&gt;
&lt;li&gt;complex → Complex numbers with letters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;id = 25             # int&lt;br&gt;
pi = 3.14            # float&lt;br&gt;
z = 2 + 3j           # complex&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;3. Boolean Type&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bool → Logical values.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;she_is_a_girl = True&lt;br&gt;
she-is_young = False&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;4. Sequence types.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;list → Ordered, changeable, allows duplicates&lt;/li&gt;
&lt;li&gt;tuple → Ordered, unchangeable, allows duplicates&lt;/li&gt;
&lt;li&gt;range → Immutable sequence of numbers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;colors = ["red", "blue"]      # list&lt;br&gt;
coordinates = (10, 20)        # tuple&lt;br&gt;
numbers = range(5)            # range&lt;br&gt;
fruits = ["mangoes", "apples"]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;5. Set Types.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;set → Unordered, no duplicates&lt;/li&gt;
&lt;li&gt;frozen set → Immutable set.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;items = {1, 2, 3}&lt;br&gt;
frozen_items = frozenset([1, 2, 3])&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;6. Mapping Type&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;dict → Key-value pairs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;person = {"name": "Alice", "age": 30}&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;7. Binary types.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bytes&lt;/li&gt;
&lt;li&gt;byte array&lt;/li&gt;
&lt;li&gt;memory view.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;data = b"hello"             # bytes&lt;br&gt;
buffer = bytearray(5)       # bytearray&lt;br&gt;
memory = memoryview(bytes(5))  # memoryview&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;8. None Type.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;None Type → Represents absence of a value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;result = None&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>DAY 2 OF LEARNING DJANGO.</title>
      <dc:creator>Chemutai Brenda</dc:creator>
      <pubDate>Thu, 26 Jun 2025 08:57:02 +0000</pubDate>
      <link>https://dev.to/chenda001/day-2-of-django-29pe</link>
      <guid>https://dev.to/chenda001/day-2-of-django-29pe</guid>
      <description>&lt;p&gt;I did research and learnt about forking, ⁠collaboration, ⁠pull requests, ⁠merge conflicts, ⁠code review, ⁠GitHub issues, ⁠git commands and ⁠pushing changes to GitHub.&lt;br&gt;
To make my learning of Django easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Forking.&lt;/strong&gt;&lt;br&gt;
Forking is creating your own copy of someone else’s repository on GitHub.&lt;br&gt;
When to use forking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When you want to contribute to an open-source project.&lt;/li&gt;
&lt;li&gt;When you want to freely experiment with changes without affecting the original.
Example:
Click the "Fork" button on a repo page → GitHub copies the repo to your account.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Collaboration.&lt;/strong&gt;&lt;br&gt;
Collaboration means working on a project with multiple people using Git + GitHub.&lt;br&gt;
Tips to use during collaboration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use branches for features.&lt;/li&gt;
&lt;li&gt;Push to shared repositories.&lt;/li&gt;
&lt;li&gt;Pull updates often to stay in sync.
Example of a code to run from the terminal.
&amp;gt; 
# get latest changes from others
git pull origin main&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Merge conflicts.&lt;/strong&gt;&lt;br&gt;
Conflicts do occur when two people change the same line in a file, or add conflicting changes especially during collaboration.&lt;br&gt;
How to resolve conflict when it occurs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git shows &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;, =======, &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; in the file.&lt;/li&gt;
&lt;li&gt;Manually edit and choose the correct content.&lt;/li&gt;
&lt;li&gt;Mark resolved
Example of a code to run from the terminal.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;git add filename&lt;br&gt;
git commit -m "Resolved conflict"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;4. Code review.&lt;/strong&gt;&lt;br&gt;
When teammates during collaboration review your pull request before merging:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comment on code.&lt;/li&gt;
&lt;li&gt;Suggest changes.&lt;/li&gt;
&lt;li&gt;Approve or request changes.
Code review is used for:&lt;/li&gt;
&lt;li&gt;Maintaining quality.&lt;/li&gt;
&lt;li&gt;Learning from feedback.&lt;/li&gt;
&lt;li&gt;Catching bugs early.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. GitHub Issues&lt;/strong&gt;&lt;br&gt;
Track bugs, features, or tasks in a project.&lt;br&gt;
Use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Title + description to explain the issue.&lt;/li&gt;
&lt;li&gt;Assign team members, add labels, or link PR
Example.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Title: Fix login bug&lt;br&gt;
Description: When a user enters the wrong password, the app crashes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;6. Git Commands.&lt;/strong&gt;&lt;br&gt;
The following are GitHub commands:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;How to clone a repo&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git clone &lt;a href="mailto:git@github.com"&gt;git@github.com&lt;/a&gt;:user/repo.git&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;How to check status:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git status&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;How to create a branch:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git checkout -b feature-xyz&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;How to switch from one branch to another:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git checkout main&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;How to add changes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git add&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;How to commit changes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git commit -m "message"&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pull updates:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git pull origin main&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;How to push changes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git push origin branch-name&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>DAY 1 OF LEARNING DJANGO.</title>
      <dc:creator>Chemutai Brenda</dc:creator>
      <pubDate>Wed, 25 Jun 2025 09:00:35 +0000</pubDate>
      <link>https://dev.to/chenda001/my-first-article-cm</link>
      <guid>https://dev.to/chenda001/my-first-article-cm</guid>
      <description>&lt;p&gt;Setting up Git, Docker, Python, Text editor(vs code) and connecting git to git git SSH in readiness to learn Django framework of Python.&lt;br&gt;
This is done for Windows.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Git&lt;br&gt;
First thing I did was make sure Git was installed and properly configured.&lt;br&gt;
Did this by getting the link to the git website and downloading it.&lt;br&gt;
I also configured my user details:&lt;br&gt;
git config --global user.name "Chenda001"&lt;br&gt;
git config --global user.email "&lt;a href="mailto:chendaketer@gmail.com"&gt;chendaketer@gmail.com&lt;/a&gt;"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python (Version 3.13)&lt;br&gt;
It is Python 3.13 to be exact.&lt;br&gt;
I Downloaded it from python.org&lt;br&gt;
Where I clicked on Windows installer before adding python to path and clicking install.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VS Code (text editor)&lt;br&gt;
It had been the easiest to download.&lt;br&gt;
link i downloaded it from: &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;https://code.visualstudio.com/&lt;/a&gt;&lt;br&gt;
And i chose the one compatible to my laptop.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;4.Docker&lt;br&gt;
I downloaded Docker for windows from the link below:&lt;br&gt;
&lt;a href="https://www.docker.com/products/docker-desktop" rel="noopener noreferrer"&gt;https://www.docker.com/products/docker-desktop&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;During setup, I enabled the WSL 2 backend in Docker settings.&lt;br&gt;
GitHub SSH Setup I created an SSH key in Ubuntu: ssh-keygen -t ed25519 -C "&lt;a href="mailto:your-email@example.com"&gt;your-email@example.com&lt;/a&gt;" Then added it to the SSH agent: eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 To copy the public key: cat ~/.ssh/id_ed25519.pub I pasted it into GitHub under: Settings → SSH and GPG Keys → New SSH key&lt;br&gt;
To test the connection:&lt;br&gt;
ssh -T &lt;a href="mailto:git@github.com"&gt;git@github.com&lt;/a&gt;&lt;br&gt;
And got:&lt;/p&gt;

&lt;p&gt;Hi your-username! You've successfully authenticated...&lt;/p&gt;

&lt;p&gt;Now my dev environment is ready. I can write Python code, use GitHub securely with SSH, run Docker containers, and work entirely inside Ubuntu using VS Code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connecting Git to Git SSH using Gitbash
Step 1 :checking for an existing SSH keys.
open Git Bash and run:
ls -al ~/.ssh&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;step 2: Generating a new git SSH &lt;br&gt;
Open git bash and run:&lt;br&gt;
ssh-keygen -t ed25519 -C "&lt;a href="mailto:chendaketer@gmail.com"&gt;chendaketer@gmail.com&lt;/a&gt;"&lt;/p&gt;

&lt;p&gt;step 3: Starting SSH Agent and add key agent&lt;br&gt;
Open Git Bash and run:&lt;br&gt;
eval "$(ssh-agent -s)"&lt;br&gt;
ssh-add ~/.ssh/id_ed25519&lt;/p&gt;

&lt;p&gt;step 4:add the public key to GitHub&lt;br&gt;
open git bash and run:&lt;br&gt;
cat ~/.ssh/id_ed25519.pub&lt;/p&gt;

&lt;p&gt;step 5:testing the SSH connection&lt;br&gt;
Open Git Bash and run:&lt;br&gt;
ssh -T &lt;a href="mailto:git@github.com"&gt;git@github.com&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
