<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by @dorothytechy on Medium]]></title>
        <description><![CDATA[Stories by @dorothytechy on Medium]]></description>
        <link>https://medium.com/@wangarraakoth?source=rss-b6830523f0e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*orIJQscK_73KlFFABeykxw.jpeg</url>
            <title>Stories by @dorothytechy on Medium</title>
            <link>https://medium.com/@wangarraakoth?source=rss-b6830523f0e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 12:17:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wangarraakoth/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Zindi Community Ambassador to Zindi Country Ambassador: My Journey with Zindi, Tech…]]></title>
            <link>https://medium.com/@wangarraakoth/from-zindi-community-ambassador-to-zindi-country-ambassador-my-journey-with-zindi-tech-2872b175351b?source=rss-b6830523f0e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2872b175351b</guid>
            <dc:creator><![CDATA[@dorothytechy]]></dc:creator>
            <pubDate>Mon, 12 Jan 2026 09:08:21 GMT</pubDate>
            <atom:updated>2026-01-12T09:15:28.863Z</atom:updated>
            <content:encoded><![CDATA[<h3>From Zindi Community Ambassador to Zindi Country Ambassador: My Journey with Zindi, Tech Communities, and Software Engineering</h3><p>In November 2023, I joined Zindi as a Community Ambassador with a clear mission: to give back to the data and AI community that had already given me so much. What started as a volunteer role quickly became a defining chapter in my life — shaping my growth as a community builder, technologist, and leader across Africa.</p><h3>Starting My Community Journey: WhatsApp AI/ML Community</h3><p>Shortly after joining Zindi, I created a WhatsApp AI/ML community to help organize events online, share knowledge, and grow the Zindi community locally. This small initiative became the backbone for:</p><ul><li>Coordinating workshops and online meetups</li><li>Sharing challenge insights and learning resources</li><li>Connecting members across Kenya</li></ul><h4>Through this experience, I learned:</h4><ul><li>How to listen to community needs and create value</li><li>How to facilitate knowledge sharing across skill levels</li><li>How to encourage collaboration and participation in AI challenges</li></ul><p>These early lessons helped me structure Zindi meetups, host my first workshops, and onboard new members into the AI and data science ecosystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*McpGExriFbzYZSX6CPQ3SQ.jpeg" /></figure><h3>Zindi Community Ambassador Responsibilities</h3><p>As a Community Ambassador, I moved from a WhatsApp group to real-life events. My focus was grassroots engagement:</p><ul><li>Organizing and growing local Zindi communities</li><li>Hosting and moderating workshops, webinars, and challenge discussions</li><li>Supporting learners entering AI and data science</li><li>Advocating for inclusive participation, especially for women in tech</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8tSO44cKdpqfEZafx5Lkg.jpeg" /></figure><h3>Promotion to Zindi Country Ambassador</h3><p>In November 2024, after a year of sustained impact, I was nominated to Zindi Country Ambassador. This role expanded my responsibilities to national strategy, partnerships, mentorship, and leadership.</p><p><strong>Key responsibilities included:</strong></p><ul><li>Representing Zindi at national and regional events</li><li>Collaborating with universities including Strathmore University, USIU–Africa, Daystar University, Maseno University, University of Nigeria, and GDG Ahlen (Germany)</li><li>Mentoring local ambassadors in South Africa, Nigeria, and Kenya</li><li>Organizing workshops, hackathons, and challenge briefings</li><li>Advocating for women and underrepresented groups in AI</li><li>Building partnerships with tech companies, NGOs, and community organizations</li></ul><p><strong>Challenges I faced:</strong></p><ul><li>Coordinating across multiple universities with limited resources</li><li>Keeping volunteer ambassadors engaged despite conflicting schedules</li><li>Managing both online and offline events with varying attendance</li><li>Balancing ambassador responsibilities with my professional software engineering career</li><li>Learning to delegate effectively — initially trying to do everything myself caused burnout</li></ul><h3>Launching Responsible AI: My First Talk at USIU</h3><p>A highlight of my ambassador journey was delivering my first talk at USIU on Responsible AI. I shared practical frameworks for ethical AI, inclusive practices, and hands-on guidance for deploying responsible AI systems.</p><p><strong>Impact:</strong></p><ul><li>Engaged over 100 students and faculty</li><li>Inspired student-led AI projects for social good</li><li>Strengthened Zindi’s academic presence in Kenya</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B--MRr17m2_uQP3GfWkdPg.jpeg" /></figure><h3>Microsoft AI Training: Nairobi 2025</h3><p>I attended a week-long Microsoft AI workshop in Nairobi, covering:</p><ul><li>AI in education and learning platforms</li><li>Generative AI and practical applications</li><li>Principles of responsible AI and governance</li></ul><p><strong>Key takeaways:</strong></p><ul><li>Integrating responsible AI into community projects</li><li>Mentoring and training ambassadors effectively</li><li>Networking with global AI professionals</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*uXF0ebdDWH1VbXfhHDbjIw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*vafWEjBwIgIKuSKXPbuY6Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*p07CYfrqoZGv3o_m8lN0pw.jpeg" /></figure><h3>Mentoring Ambassadors Across Africa</h3><p>Mentorship became a central part of my work. I guided ambassadors in South Africa, Nigeria, and Kenya, focusing on:</p><ul><li>Community growth strategies</li><li>Event organization and execution</li><li>Partnership building with universities and tech companies</li><li>Developing leadership skills and sustainability</li><li>Currently I am mentoring 9 new zindi ambassadors from different countries</li><li>Leading local universities in hosting their hackathons into zindi platform — a picture of Daystar University Students below</li></ul><p>Seeing ambassadors launch initiatives and scale their communities was incredibly rewarding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*VTaP5PM7gmUePgwvEhVAjQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0-fDG6yxt-mthl7L1LqhQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fK4ktRkmCB613A2ZbVDqaQ.jpeg" /></figure><h3>Upcoming Strategic Partnership: Africa Tech Summit 2026</h3><p>Looking ahead, I am supporting a strategic partnership for Zindi at the Africa Tech Summit, set to launch in February 2026 Nairobi. This upcoming collaboration will:</p><ul><li>Position Zindi at the center of Africa’s AI and innovation ecosystem</li><li>Provide opportunities for African talent to engage with global stakeholders</li><li>Strengthen Zindi as a platform for real-world, data-driven solutions</li></ul><h3>Deep Learning Indaba — Rwanda 2025 Through Zindi</h3><p>One of the most transformative experiences in my journey was participating in the <strong>Deep Learning Indaba</strong>, facilitated through Zindi. The Indaba is more than just a conference — it is a celebration of African AI talent, collaboration, and knowledge sharing.</p><p>Some of the activities I participated in included:</p><ul><li><strong>Serving as a poster judge</strong> — Evaluating student and researcher projects, providing constructive feedback, and encouraging innovative approaches to AI challenges.</li><li><strong>Connecting with AI professionals</strong> — Networking with academics, researchers, and industry practitioners from across Africa to exchange ideas and insights.</li></ul><p><strong>Impact of my involvement:</strong></p><ul><li>Strengthened my local and regional AI network through meaningful professional connections.</li><li>Helped nurture emerging AI talent by providing mentorship and feedback.</li><li>Encouraged participants to pursue practical AI applications and participate in Zindi challenges, extending learning beyond the Indaba.</li><li>Reinforced the importance of <strong>community-driven learning and collaboration</strong> in advancing African AI.</li></ul><h3>Balancing Community Leadership with a Professional Career</h3><p>Alongside my ambassador role, I continue to grow as a software engineer. Balancing engineering work with community leadership has been challenging but deeply fulfilling.</p><p><strong>Roles and Industry Projects:</strong></p><ul><li><strong>Kaakazini Website:</strong> Contributed to full-stack development, implementing service discovery, user authentication, and dynamic dashboards.</li><li><strong>Saspacity Website:</strong> Built backend systems and integrated APIs to enable smooth civic and business services.</li><li><strong>LigiOpen Website:</strong> Developed tournament management tools, live match updates, and registration workflows for a sports platform.</li><li><strong>Uniport Loan System:</strong> Implemented loan application workflows, repayment tracking, and secure authentication for students and staff.</li></ul><p><strong>Strategies that helped me manage both:</strong></p><ul><li><strong>Time-blocking:</strong> Dedicated hours for community work and professional tasks</li><li><strong>Online tools:</strong> Using WhatsApp, Zoom, and Slack for efficient coordination</li><li><strong>Delegation:</strong> Empowering ambassadors to lead local initiatives</li><li><strong>Prioritizing impact:</strong> Focusing on high-value community and career projects</li></ul><p>If you want to <strong>follow me on Zindi for collaboration</strong> on challenges and competitions, or learn more about the Zindi platform and how to get started with AI competitions in Africa, you can join here: https://bit.ly/3JHKloR</p><p>I’d love to connect with fellow learners, mentors, and enthusiasts to <strong>tackle real-world AI problems together</strong> and grow Zindi community impact.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2872b175351b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Technical Documentation for Models.py in Django Application.]]></title>
            <link>https://medium.com/@wangarraakoth/technical-documentation-for-models-py-in-django-application-342d3318c949?source=rss-b6830523f0e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/342d3318c949</guid>
            <category><![CDATA[django-framework]]></category>
            <dc:creator><![CDATA[@dorothytechy]]></dc:creator>
            <pubDate>Mon, 02 Sep 2024 01:46:59 GMT</pubDate>
            <atom:updated>2024-09-02T01:47:32.678Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Introduction</h3><p>This document provides a detailed overview of the <strong><em>models.py</em></strong> file in a Django application. The <strong><em>models.py</em></strong> file is where Django&#39;s ORM (Object-Relational Mapping) models are defined. These models are Python classes that represent database tables. Each class attribute in the model corresponds to a database field.</p><h3>2. Purpose of models.py</h3><p>The primary purpose of <strong><em>models.py</em></strong> is to define the structure of your database. Django models provide an abstraction layer that allows you to interact with your database using Python code instead of writing raw SQL queries. This abstraction enhances productivity and reduces the likelihood of errors.</p><h3>3. Key Components of models.py</h3><h4>Model Class</h4><p>A Django model is defined as a subclass of <strong><em>django.db.models.Model</em></strong> Each model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4lTBgO6VfVPafqmwVtPRgQ.png" /></figure><h4>Fields</h4><p>Each attribute of the model class represents a database field. Django provides a variety of field types, such as <strong><em>CharFiled, IntegerField, DateField</em></strong>, and more.</p><p><strong>Common Field Types:</strong></p><ul><li><strong><em>CharField</em></strong>: For storing strings (requires <strong><em>max-length</em></strong> argument).</li><li><strong><em>IntegerField</em></strong>: For storing integers.</li><li><strong><em>DateField</em></strong>: For storing date values.</li><li><strong><em>BooleanField</em></strong>: For storing <strong><em>True/False </em></strong>values.</li><li><strong><em>FoeignKey</em></strong>: For creating a many-to-one relationship with another model.</li></ul><h3><strong>To be continued with!!!!</strong></h3><h3><strong>Enjoy Reading this!!!</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=342d3318c949" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD Pipeline Using GitHub Actions]]></title>
            <link>https://medium.com/@wangarraakoth/ci-cd-pipeline-using-github-actions-ce69598e231e?source=rss-b6830523f0e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce69598e231e</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[yaml-basic]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[@dorothytechy]]></dc:creator>
            <pubDate>Mon, 02 Sep 2024 01:29:48 GMT</pubDate>
            <atom:updated>2024-09-02T01:29:48.811Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This document describes setting up a Continuous Integration and Continuous Deployment (CI/CD) pipeline using GitHub Actions. The pipeline automates the testing, building, and deployment of your application whenever changes are pushed to the repository.</p><h3>2. Prerequisites</h3><p>Before setting up the CI/CD pipeline, ensure the following prerequisites are met:</p><ul><li>A GitHub repository containing your application code.</li><li>Basic knowledge of YAML syntax.</li><li>Access to a deployment environment (e.g. a server, cloud service, or hosting platform).</li><li>Required secrets or environment variables configured in the GitHub repository (e.g. API keys, SSH keys).</li></ul><h3>3. Pipeline Overview</h3><p>The CI/CD pipeline consists of the following stages:</p><ol><li><strong>Build</strong>: Compile and build the application.</li><li><strong>Test</strong>: Run unit tests to ensure code quality.</li><li><strong>Deploy</strong>: Deploy the application to the designated environment.</li></ol><p>Each stage is triggered by events such as code commits, pull requests, or tag creations in the GitHub repository.</p><h3>Setting Up GitHub Actions</h3><h3>Creating a Workflow File</h3><p>To create a CI/CD pipeline using GitHub Actions, you need to define a workflow file in your repository. This file is typically located in the .<strong><em>github/workflows</em></strong> directory.</p><p>Example: <strong><em>ci-cd .yaml file</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iyoewaxZmXhS8uB-E9XJPw.png" /></figure><h3>Workflow Breakdown</h3><ul><li><strong>Name:<em> CI/CD Pipeline</em></strong>- The name of the pipeline.</li><li><strong>On:<em> push</em></strong>, <strong><em>pull-request</em></strong>, and <strong><em>workflow-dispatch</em></strong>- The events that trigger the workflow.</li><li><strong>Jobs:</strong> <strong><em>build</em></strong> and <strong><em>deploy</em></strong>- The stages of the pipeline.</li></ul><h4>Build Job</h4><ul><li><strong>runs-on:<em> ubuntu-latest</em></strong> - The virtual environment where the job will run.</li><li><strong>steps:</strong></li><li><strong>Checkout code</strong>: Uses the <strong><em>actions/checkout@v2</em></strong> action to clone the repository.</li><li><strong>Set up Node.js</strong>: Uses the <strong><em>actions/setup-node@v2</em></strong> action to set up Node.js.</li><li><strong>Install dependencies</strong>: Installs project dependencies using <strong><em>npm install</em></strong></li><li><strong>Run tests</strong>: Run unit tests using the<strong><em> npm test.</em></strong></li><li><strong>Build application</strong>: Builds the application using <strong><em>npm run build.</em></strong></li></ul><h4>Deploy Job</h4><ul><li><strong>needs:</strong> <strong><em>build</em></strong>- Specifies that the deploy job depends on the successful completion of the build job.</li><li><strong>if:</strong> GitHub.<strong><em>ref==’refs/heads/main’</em></strong> - Ensures deployment only occurs when changes are pushed to the <strong><em>main</em></strong> branch.</li><li><strong>steps:</strong></li><li><strong>Checkout code</strong>: Clones the repository.</li><li><strong>Deploy to production</strong>: Executes the deployment script. You can customize this step to fit your deployment strategy (e.g. SSH to a server, upload to cloud storage).</li></ul><h3>Secrets and Environment Variables</h3><p>Store sensitive data like deployment keys or API tokens securely in GitHub by using the repository’s Secrets feature:</p><ul><li>Go to <strong>Settings &gt; Secrets</strong> in your GitHub repository.</li><li>Click <strong>New Repository secret</strong>.</li><li>Add secrets with names such as <strong><em>DEPLOY_KEY</em></strong>.</li></ul><p>These secrets can be accessed within the workflow file using <strong><em>secrets</em></strong>. <strong><em>&lt;SECRET_NAME&gt;</em></strong></p><h3>Monitoring and Debugging</h3><ul><li><strong>Workflow Logs:</strong> GitHub Actions provides logs for each workflow run, accessible in the Actions tab of the repository.</li><li><strong>Error Handling:</strong> Use <strong><em>continue_on_error=true</em></strong> in job steps to allow the pipeline to continue even if a particular step fails.</li></ul><h3>6. Best Practices</h3><ul><li><strong>Modular Workflows:</strong> Break down complex workflows into smaller, reusable workflows using reusable workflows and composite actions.</li><li><strong>Environment-Specific Workflows:</strong> Separate workflows for different environments (e.g. staging, production).</li><li><strong>Testing:</strong> Ensure comprehensive tests are in place to catch issues early in the CI stage.</li><li><strong>Notifications:</strong> Integrate notifications (e.g. Slack, email) to stay informed of the pipeline status.</li></ul><h3>Happy READING!!!!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce69598e231e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to host Python/Django Applications on Cpanel]]></title>
            <link>https://medium.com/@wangarraakoth/how-to-host-python-django-applications-on-cpanel-310e9b52311c?source=rss-b6830523f0e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/310e9b52311c</guid>
            <category><![CDATA[django-framework]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[cpanel-hosting]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[@dorothytechy]]></dc:creator>
            <pubDate>Sun, 01 Sep 2024 17:27:36 GMT</pubDate>
            <atom:updated>2024-09-01T17:27:36.350Z</atom:updated>
            <content:encoded><![CDATA[<p>Hosting a Django application on cPanel involves several steps, from setting up your environment to deploying the application. Here’s a step-by-step guide:</p><h3>Prerequisites:</h3><ul><li>Access to a cPanel account with terminal access (SSH).</li><li>A Django application ready for deployment.</li><li>Basic knowledge of SSH, Python, and Django.</li></ul><h3>Step 1: Log in to cPanel</h3><ol><li>Go to your domain’s cPanel URL (usually <strong><em>https:yourdomain.com/cpanel) </em></strong>and log in with your credentials.</li></ol><h3>Step 2: Access Terminal (SSH)</h3><ol><li>In the cPanel dashboard, search for <strong>Terminal</strong> or <strong>SSH Access</strong> and open it.</li><li>Alternatively, you can use an SSH client like PuTTY to access your cPanel account via SSH.</li></ol><h3>Step 3: Create a Python Application</h3><ol><li>In cPanel, search for <strong>Setup Python App</strong> under the <strong>Software</strong> section and click on it.</li><li>Click on the <strong>Create Application</strong> button.</li><li>Select the Python version (choose one compatible with your Django project).</li><li>Choose the directory where you want to install the Django application (for example. <strong><em>home/user/myapp</em></strong>).</li><li>Enter the application’s URI (for example. /myapp).</li><li>Click on <strong>Create</strong>.</li></ol><h3>Step 4: Install Django and Dependencies</h3><ol><li>After creating the application, cPanel will provide a path to a virtual environment.</li><li>Click on the <strong>Open</strong> link next to the terminal icon in the Python setup interface to access the virtual environment.</li><li>Install Django and your application’s dependencies:</li></ol><p><strong><em>pip install django pip install -r</em></strong></p><p><strong><em>/home/youruser/myapp/requirements.txt</em></strong></p><h3>Step 5: Configure Django Application</h3><ol><li>Modify your Django <strong><em>settings.py </em></strong>file:</li></ol><ul><li>Set <strong>ALLOWED_HOSTS</strong> to include your domain:<br><strong><em>ALLOWED_HOSTS=[‘yourdomain.com’, ‘www.yourdomain.com&#39;]</em></strong></li><li>Set the <strong><em>STATIC_ROOT </em></strong>to a directory within your project:</li></ul><p><strong><em>STATIC_ROOT=os.path.join(BASE_DIR, ‘static’)</em></strong></p><p><strong>Collect static files:</strong></p><p><em>python manage.py collectstatic</em></p><h3>Step 6: Configure Apache</h3><ol><li>In cPanel, go to <strong>File Manager</strong>.</li><li>Navigate to your project directory (e.g. <strong><em>/home/youruser/myapp)</em></strong>.</li><li>Restart your Apache server (you may need to ask your hosting provider for assistance if you do not have direct access to server management).</li></ol><h3>Step 7: Test Your Application</h3><ol><li>Visit your domain in the browser (For example <strong><em>https://yourdomain.com/myapp</em></strong>)</li><li>Ensure everything is working correctly.</li></ol><h3>Step 8: Set Up Database (Optional)</h3><ol><li>If you’re using a database like PostgreSQL or MySQL, set it up via cPanel’s <strong>MySQL Databases</strong> or <strong>PostgreSQL Databases</strong>.</li><li>Update your <strong><em>settings.py file with </em></strong>the correct database credentials.</li><li>Run migrations:</li></ol><p><strong><em>python manage.py migrate</em></strong></p><h3>Step 9: Secure Your Application (Optional)</h3><ol><li>Enable HTTPS by setting up an SSL certificate through cPanel’s <strong>SSL/TLS</strong> manager.</li><li>Update your Django settings to force <strong><em>HTTPS: Secure__SSL_REDIRECT=True</em></strong></li><li>Add any additional security settings, such as</li></ol><p><strong><em>SECURE_HSTS_SECONDS,</em></strong></p><p><strong><em>SECURE_HSTS_INCLUDE_SUBDOMAINS</em></strong></p><h3>Step 10: Maintain Your Application</h3><ul><li>Regularly update your packages and Django version.</li><li>Monitor logs for any issues and address them promptly.</li><li>Consider setting up error reporting and performance monitoring.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=310e9b52311c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Send Emails in Python/Django Applications Using a Gmail Account]]></title>
            <link>https://medium.com/@wangarraakoth/how-to-send-emails-in-python-django-applications-using-a-gmail-account-b14895034bac?source=rss-b6830523f0e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b14895034bac</guid>
            <category><![CDATA[django-framework]]></category>
            <category><![CDATA[html5]]></category>
            <dc:creator><![CDATA[@dorothytechy]]></dc:creator>
            <pubDate>Tue, 27 Aug 2024 18:00:49 GMT</pubDate>
            <atom:updated>2024-08-27T18:00:49.009Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>To create and send emails using Django, you can use Django’s built-in email functionality. Here’s a step-by-step guide on how to set it up and send emails:</li></ul><h3>1. Set Up Email Backend in Django Settings</h3><p>First, configure your email backend in <strong><em>settings.py</em></strong>.</p><pre><strong><em>EMAIL_BACKEND = &#39;django.core.mail.backends.smtp.EmailBackend&#39;<br>EMAIL_HOST = &#39;smtp.gmail.com&#39;  # For Gmail<br>EMAIL_PORT = 587  <br>EMAIL_USE_TLS = True  # Use TLS<br>EMAIL_HOST_USER = &#39;your_email@gmail.com&#39;  <br>EMAIL_HOST_PASSWORD = &#39;your_password&#39; </em></strong> </pre><h3>2. Create a View to Send an Email</h3><p>Now, create a view that will handle sending the email.</p><pre><strong><em>from django.core.mail import send_mail<br>from django.shortcuts import render<br>from django.http import HttpResponse</em></strong></pre><pre><strong><em>def send_email_view(request):<br>    if request.method == &#39;POST&#39;:<br>        subject = &#39;Subject of the email&#39;<br>        message = &#39;This is the message body of the email.&#39;<br>        from_email = &#39;your_email@gmail.com&#39;<br>        recipient_list = [&#39;recipient@example.com&#39;]</em></strong></pre><pre><strong><em>        send_mail(subject, message, from_email, recipient_list)</em></strong></pre><pre><strong><em>        return HttpResponse(&#39;Email sent successfully.&#39;)<br>    return render(request, &#39;send_email.html&#39;)</em></strong></pre><h3>3. Create a Template for the Email Form</h3><p>You can create a simple HTML form to trigger the email sending.</p><pre><strong><em>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;Send Email&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;h2&gt;Send Email&lt;/h2&gt;<br>    &lt;form method=&quot;post&quot;&gt;<br>        {% csrf_token %}<br>        &lt;button type=&quot;submit&quot;&gt;Send Email&lt;/button&gt;<br>    &lt;/form&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</em></strong></pre><h3>4. Configure URL Routing</h3><p>Add a URL pattern to route to the view that handles email sending</p><pre><strong><em>from django.urls import path<br>from .views import send_email_view</em></strong></pre><pre><strong><em>urlpatterns = [<br>    path(&#39;send-email/&#39;, send_email_view, name=&#39;send_email&#39;),<br>]</em></strong></pre><h3>5. Test the Email Functionality</h3><p>Run your Django application and navigate to the URL you configured (e.g., <strong><em>http://127.0.0.1:8000/send-email/</em></strong>). Click the &quot;Send Email&quot; button, and an email should be sent to the specified recipient.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b14895034bac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting a Python/Django Application to a MySQL Database]]></title>
            <link>https://awstip.com/connecting-a-python-django-application-to-a-mysql-database-06275cbf9da4?source=rss-b6830523f0e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/06275cbf9da4</guid>
            <category><![CDATA[windows-10]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[xampp-server]]></category>
            <dc:creator><![CDATA[@dorothytechy]]></dc:creator>
            <pubDate>Sun, 25 Aug 2024 23:46:43 GMT</pubDate>
            <atom:updated>2024-09-02T17:48:14.224Z</atom:updated>
            <content:encoded><![CDATA[<h4>Prerequisites</h4><p>Make sure the following is installed on your system:</p><ul><li><strong>Python</strong>: Ensure Python is installed.</li></ul><p>First, activate the Python environment using the following command in the Visual Studio terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mORtlftU_xazdqc_z_k-JA.png" /></figure><ul><li><strong>Django</strong>: Install Django in your environment.</li><li>using: <strong><em>pip install Django</em></strong> as shown below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MlcEUa8cdDrHdz3eL83fcQ.png" /></figure><p>Start a Django project using the following command:<br><strong><em>django-admin startproject connector<br>cd connector</em></strong></p><p>Create a Django application using the following command:<br><strong><em>python manage.py startapp user</em></strong></p><p><strong>XAMPP</strong>: Install XAMPP to run MySQL Server locally.</p><ul><li><strong>MySQL Client</strong>: Install the MySQL client library for Python (<strong><em>mysqlclient</em></strong>).</li></ul><p>using this command :<br><strong>Step 1: Install the MySQL Client Library</strong></p><p>Install the MySQL client library that Django uses to interact with a MySQL database. The recommended package is <strong><em>mysqlclient</em></strong>.</p><p><strong><em>pip install mysqlclient</em></strong></p><h3>Step 2: Set Up Your MySQL Database Using XAMPP</h3><ol><li><strong>Start MySQL Server:</strong></li></ol><ul><li>Open XAMPP Control Panel.</li><li>Start the MySQL service by clicking the “Start” button next to MySQL.</li></ul><ol><li><strong>Access phpMyAdmin:</strong></li></ol><ul><li>Open a web browser and go to <a href="http://localhost/phpmyadmin/"><strong><em>http://localhost/phpmyadmin/</em></strong></a></li><li>This will open the phpMyAdmin interface, where you can manage MySQL databases.</li></ul><ol><li><strong>Create a Database:</strong></li></ol><ul><li>In phpMyAdmin, click on “Databases” in the top menu.</li><li>Enter a name for your database in the “Create database” field for example my database name: <strong><em>practice</em></strong></li><li>Click “Create” to create the database.</li></ul><ol><li><strong>Create a User and Grant Privileges:</strong></li></ol><ul><li>In phpMyAdmin, click on the “User Accounts” tab.</li><li>Click “Add user account” and fill in the following details:</li><li><strong>Username</strong>: Enter a username (e.g. <strong><em>your_username</em></strong>).</li><li><strong>Host</strong>: Select “Local” or enter <strong><em>localhost</em></strong>.</li><li><strong>Password</strong>: Enter a strong password (e.g. <strong><em>your_password</em></strong>).</li><li>Scroll down to “Global privileges” and check “Check All”.</li><li>Click “Go” to create the user with the privileges.</li></ul><h3>Step 3: Configure Django Settings</h3><p>Open your Django project’s <strong><em>settings.py</em></strong> file and configure the <strong><em>DATABASES</em></strong> setting to use MySQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*et48x2VCXOWKGoNKN7OxnA.png" /></figure><h3>Step 4: Migrate the Database</h3><p>After setting up your <strong><em>settings.py</em></strong>, apply migrations to create the necessary tables in the MySQL database.</p><p>Use the following commands:<br><strong><em>python manage.py makemigrations<br>python manage.py migrate</em></strong></p><h3>Step 5: Verify the Connection</h3><p>Start the Django development server to ensure everything is working correctly.</p><p>using the following command:<br><strong><em>python manage.py runserver</em></strong></p><p>And make sure Xampp server is on.</p><h4><strong><em>For Django Beginners!!!!!</em></strong></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06275cbf9da4" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/connecting-a-python-django-application-to-a-mysql-database-06275cbf9da4">Connecting a Python/Django Application to a MySQL Database</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I got into Tech]]></title>
            <link>https://medium.com/@wangarraakoth/how-i-got-into-tech-0f6f5022ea52?source=rss-b6830523f0e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f6f5022ea52</guid>
            <dc:creator><![CDATA[@dorothytechy]]></dc:creator>
            <pubDate>Wed, 03 Jul 2024 13:20:20 GMT</pubDate>
            <atom:updated>2024-07-03T14:23:55.962Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*eHo7yphV9UVHXU7o3Vpi3w.jpeg" /></figure><p>Hello World! After high school, what’s next? During the COVID-19 pandemic in 2020, while at my cousin’s house, I trained myself on how to create folders. Did I even know how folders were being created? Thanks to my cousin, who showed me ways to develop and learn code through <a href="https://www.w3schools.com/">W3Schools</a>. Nowadays, there are lots of resources one can learn from, but as a beginner, I started learning from W3Schools. However, writing code by myself was not easy, so a friend of mine, Kimberly Msabeni, invited me to a hackathon at <a href="https://www.lakehub.co.ke/">LakeHub</a>.</p><p>Guess what? I never knew what a hackathon was since it was my first time attending one. My presentation was all about how women and girls can be protected against early pregnancy. I had some beautiful slides but never created an app because I didn’t know about coding back then.</p><p><strong>During the hackathon:<br>- </strong>I got to learn and connect with different developers from Maseno University and also some judges from Safaricom. I was the happiest lady ever since it was my first tech event.</p><p><em>LinkedIn: </em><a href="https://www.linkedin.com/in/dorothy-akoth/"><em>https://www.linkedin.com/in/dorothy-akoth/</em></a><em><br>Twitter: </em><a href="https://medium.com/u/b6830523f0e4"><em>@dorothytechy</em></a><em><br>Software Developer/Zindi Ambassador-Kenya</em></p><p><em>Stay connected for my next blog</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f6f5022ea52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[User Authentication in FastAPI using Python:]]></title>
            <link>https://medium.com/@wangarraakoth/user-authentication-in-fastapi-using-python-3b51af11b38d?source=rss-b6830523f0e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b51af11b38d</guid>
            <dc:creator><![CDATA[@dorothytechy]]></dc:creator>
            <pubDate>Sun, 03 Sep 2023 15:08:18 GMT</pubDate>
            <atom:updated>2023-09-03T15:08:18.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OMvRurulF3Zgb7CcebUuHg.png" /></figure><p>User authentication is a way to make sure that only the right people can access certain parts of a website. In this article , we’ll learn how to use FastAPI, a powerful web framework, to set up user authentication in a Python application using tokens.</p><h4>Table of Contents</h4><ol><li><em>Introduction to User Authentication</em></li><li><em>Prerequisites</em></li><li><em>Setting Up a FastAPI Project</em></li><li><em>User Model and Data Store</em></li><li><em>Implementing Token-Based Authentication</em></li><li><em>Securing Endpoints</em></li><li><em>Testing Authentication</em></li></ol><h4>1. Introduction to User Authentication</h4><p>User authentication is about confirming who users are before allowing them to use specific parts of a website. Token-based authentication is a popular method where users provide their credentials to get a special token. This token is used to confirm their identity for future visits.</p><h4>2. Prerequisites</h4><p>Before we start, make sure you have Python and a tool called “pip” (for managing packages) installed. You also need to install FastAPI and Uvicorn, which is a server. You can do this using these commands:</p><p><em>pip install fastapi uvicorn</em></p><h4>3.Setting Up a FastAPI Project</h4><p>Let’s start by creating a basic FastAPI project:</p><p>Create a directory for your project:</p><p><em>mkdir fastapi-authentication<br>cd fastapi-authentication</em></p><p>Inside the project directory create a virtual environment using the following commands:</p><p><em>python -m venv venv<br>source venv/bin/activate</em></p><p>Install fastapi and uvicorn in the virtual environment</p><p><em>pip install fastapi uvicorn</em></p><ol><li>Create a file named main.py in the project directory and add the following code:</li></ol><pre>from fastapi import FastAPI<br><br>app = FastAPI()<br><br>@app.get(&quot;/&quot;)<br>def read_root():<br>    return {&quot;message&quot;: &quot;Welcome to my FastAPI User Authentication!&quot;}</pre><h4>4. User Model and Data Store</h4><p>In this section, we’ll define a user model and a simple data store to keep track of registered users.</p><ol><li>Create a directory named models in the project directory.</li><li>2.Inside the models directory, create a file named user.<em>py</em> and define the user model:</li></ol><pre><br>from pydantic import BaseModel<br><br>class User(BaseModel):<br>    username: str<br>    password: str</pre><ol><li>Create a directory named data in the project directory.</li><li>Inside the data directory, create a file named users.py and define a dictionary to store user data:</li></ol><pre>from ..models.user import User<br><br>users_db = {<br>    &quot;user1&quot;: User(username=&quot;user1&quot;, password=&quot;password1&quot;),<br>    &quot;user2&quot;: User(username=&quot;user2&quot;, password=&quot;password2&quot;),<br>}</pre><h4>5. Implementing Token-Based Authentication</h4><p>let’s implement token-based authentication using FastAPI’s built-in tools.</p><ol><li>Create a directory named auth in the project directory.</li><li>Inside the auth directory, create a file named authentication.py and add the following code:</li></ol><pre>from fastapi.security import OAuth2PasswordBearer<br>from jose import JWTError, jwt<br>from datetime import datetime, timedelta<br><br>from ..models.user import User<br><br>SECRET_KEY = &quot;your-secret-key&quot;<br>ALGORITHM = &quot;HS256&quot;<br>ACCESS_TOKEN_EXPIRE_MINUTES = 30<br><br>oauth2_scheme = OAuth2PasswordBearer(tokenUrl=&quot;token&quot;)<br><br>def create_access_token(data: dict):<br>    to_encode = data.copy()<br>    expire = datetime.utcnow() + timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)<br>    to_encode.update({&quot;exp&quot;: expire})<br>    encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)<br>    return encoded_jwt<br><br>def get_current_user(token: str = Depends(oauth2_scheme)):<br>    credentials_exception = HTTPException(<br>        status_code=401,<br>        detail=&quot;Could not validate credentials&quot;,<br>        headers={&quot;WWW-Authenticate&quot;: &quot;Bearer&quot;},<br>    )<br>    try:<br>        payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])<br>        username: str = payload.get(&quot;sub&quot;)<br>        if username is None:<br>            raise credentials_exception<br>        return username<br>    except JWTError:<br>        raise credentials_exception</pre><h4>6. Securing Endpoints</h4><ol><li>Open the <em>main</em>.py file and add the following code to import the necessary modules:</li><li>Create an endpoint to generate tokens</li></ol><pre>from fastapi import FastAPI, Depends, HTTPException<br>from .auth.authentication import oauth2_scheme, get_current_user, create_access_token<br>from .models.user import User<br>from .data.users import users_db<br><br>app = FastAPI()<br>@app.post(&quot;/token&quot;)<br>async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends()):<br>    user = users_db.get(form_data.username)<br>    if user is None or user.password != form_data.password:<br>        raise HTTPException(status_code=400, detail=&quot;Incorrect username or password&quot;)<br>    access_token = create_access_token(data={&quot;sub&quot;: user.username})<br>    return {&quot;access_token&quot;: access_token, &quot;token_type&quot;: &quot;bearer&quot;}<br><br><br>@app.get(&quot;/protected&quot;)<br>async def protected_route(username: str = Depends(get_current_user)):<br>    return {&quot;message&quot;: f&quot;Hello, {username}! This is a protected resource.&quot;}</pre><h4>7. Testing Authentication</h4><ol><li>Run your FastAPI application:</li></ol><pre>uvicorn main:app --reload</pre><ol><li>Open a web browser or API client and navigate to <a href="http://127.0.0.1:8000/"><em>http://127.0.0.1:8000</em></a> to see the welcome message.</li><li>To obtain an access token, send a POST request to <a href="http://127.0.0.1:8000/token"><em>http://127.0.0.1:8000/token</em></a> with the following JSON data:</li></ol><pre>{<br>  &quot;username&quot;: &quot;user1&quot;,<br>  &quot;password&quot;: &quot;password1&quot;<br>}</pre><ol><li>Copy the received access token.</li><li>Make a GET request to the protected endpoint <a href="http://127.0.0.1:8000/protected"><em>http://127.0.0.1:8000/protected</em></a> and include the access token in the &quot;Authorization&quot; header as follows:</li></ol><pre>Authorization: Bearer &lt;access_token&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b51af11b38d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>