<?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 Bernabas Tekkalign on Medium]]></title>
        <description><![CDATA[Stories by Bernabas Tekkalign on Medium]]></description>
        <link>https://medium.com/@Barnaan?source=rss-2d09cd18f88d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MuLXNNvfex44tt7qTqhgOw.jpeg</url>
            <title>Stories by Bernabas Tekkalign on Medium</title>
            <link>https://medium.com/@Barnaan?source=rss-2d09cd18f88d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:37:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Barnaan/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[Why I Stopped Using Django ?]]></title>
            <link>https://medium.com/@Barnaan/why-i-stopped-using-django-f531050ebbd4?source=rss-2d09cd18f88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f531050ebbd4</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[django-rest-framework]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Bernabas Tekkalign]]></dc:creator>
            <pubDate>Fri, 21 Feb 2025 19:29:36 GMT</pubDate>
            <atom:updated>2025-02-21T19:29:36.766Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yvZAejg5bjCwkPNJfcgZHw.png" /><figcaption>why stopped django banner by Barnaan.</figcaption></figure><p><strong>Four years ago, when I first learned Django, I thought it was the best backend framework.</strong><br> Even today, I still believe it’s one of the best for <strong>efficiency and security</strong>. But here’s the truth I want you to understand:</p><p>👉 <strong>Frameworks are like cars.</strong> They can either be <strong>fast or safe</strong>, but rarely both.</p><p>Let me explain. If you want to drive at top speed, you <strong>trade off some safety</strong>. Car manufacturers make speed adjustments by reducing weight, using <strong>lighter materials</strong>, which can make the car <strong>less safe</strong> than an iron-built vehicle.</p><h3>So, where does Django fit in?</h3><p>Django is like a <strong>Toyota Land Cruiser</strong> — solid, secure, and reliable. It gets you where you need to go <strong>safely</strong>. But if you’re trying to <strong>race</strong> at high speed, it’s not the best fit.</p><p>👉 If you need a <strong>lightweight, real-time, and flexible</strong> framework, Django starts to feel like racing with a <strong>Ferrari engine inside a Toyota.</strong></p><h3>Why I Use Express.js More These Days</h3><p>As a <strong>backend developer and CEO of </strong><a href="https://www.yaisoftwares.com/"><strong>YAI Software Technologies</strong></a>, I work on many projects where speed and agility matter more than extreme security.</p><p>Most of the time, we create <strong>MVPs (Minimum Viable Products)</strong> to test market demand. Many of these projects involve <strong>real-time communication</strong> (like chat apps), which Django is <strong>not great at</strong>.</p><p>For these cases, we prefer <strong>Express.js</strong> because:<br> 1. It’s <strong>lightweight and fast</strong>.<br> 2. It works very well with <strong>NoSQL databases</strong> like MongoDB.<br> 3. It’s a better fit for <strong>real-time applications</strong> (WebSockets, live updates, etc.).<br> 4. Deploying is <strong>simpler and faster</strong> compared to Django.</p><h3>But Don’t Get Me Wrong… Django is Still Amazing!</h3><p>We’ve built <strong>5+ successful projects</strong> using Django. For applications requiring <strong>robust security, scalability, and structured development</strong>, Django is still a <strong>top choice</strong>.</p><p>However, in the past year alone, <a href="https://www.yaisoftwares.com/"><strong>YAI Software Technologies</strong></a> helped <strong>10+ clients worldwide</strong> build solutions using Express.js. It’s simply a <strong>more efficient tool</strong> for our current needs.</p><h3>A Final Thought: Frameworks Are NOT Religions!</h3><p>Use the right tool for the job. <strong>Django is amazing for what it does. Express.js is amazing for what it does.</strong> Pick what works best for your project instead of sticking to one framework blindly.</p><p>💬 <strong>What do you think?</strong> Have you faced similar challenges with Django or Express.js? Drop your thoughts in the comments! Don’t forget to follow for related contents!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f531050ebbd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Have you ever wondered what a CORS error is?]]></title>
            <link>https://medium.com/@Barnaan/have-you-ever-wondered-what-a-cors-error-is-6f44f659ee9a?source=rss-2d09cd18f88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f44f659ee9a</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[cors]]></category>
            <dc:creator><![CDATA[Bernabas Tekkalign]]></dc:creator>
            <pubDate>Mon, 17 Feb 2025 21:10:26 GMT</pubDate>
            <atom:updated>2025-02-17T21:10:26.144Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*4HJTc2PNV86MGS_dugU9ew.gif" /><figcaption>Cors GIF</figcaption></figure><p>When the internet was first created, its usage was to display web pages. However, as technology evolved, websites began fetching data from different sources — not necessarily located on the same server. While this have many advantages, it also has security risks, such as exposing your external resources to unauthorized access.</p><p>For example, imagine you have a website called <a href="http://www.yaisoftwares.com/"><strong>www.yaisoftwares.com</strong></a>, which fetches data from <strong>www.github.com/api/ . </strong>If someone discovers this API endpoint, they could directly access the data or even attempt different types of attacks on it.</p><p>This is where <strong>CORS (Cross-Origin Resource Sharing)</strong> says NOOOO. I often Think of it as a security guard for the browser —&gt; it ensures that only allowed sources can send requests to a server. When an API endpoint is accessed from a browser, the browser first asks the server if the request’s origin is permitted. If its allowed, the request proceeds, otherwise, the browser blocks it and shows a CORS error(The one you love to hate).</p><p><strong>How to resolve a CORS error? </strong><br>You have two main options(<a href="https://medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9">to learn more read this </a>)</p><ol><li><strong>Allow all origins</strong> — This is the easiest and what most developers do(not recommended).</li><li><strong>Specify allowed origins</strong> — The safer approach is to define which origins are allowed to access your API.</li></ol><p><strong>Share this to help someone struggling to understand CORS!</strong><br>Follow for more content like this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f44f659ee9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automatic API Documentation for Express.js Using Swagger]]></title>
            <link>https://awstip.com/automatic-api-documentation-for-express-js-using-swagger-bd3c6a431c36?source=rss-2d09cd18f88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd3c6a431c36</guid>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[api-documentation]]></category>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[expressjs]]></category>
            <dc:creator><![CDATA[Bernabas Tekkalign]]></dc:creator>
            <pubDate>Mon, 19 Feb 2024 12:23:20 GMT</pubDate>
            <atom:updated>2024-03-08T12:23:31.105Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QU4WdSXWBWAHUpU4Q2nOvg.png" /><figcaption>swagger logo</figcaption></figure><p>Documenting your API is crucial for good integration with other developers. It is also a tedious task, and hopefully, some tools help us, but still, most of the work remains on our side .I’m excited to introduce you to a streamlined approach that leverages automation, reducing your documentation efforts significantly.</p><p>By following a few simple steps, you can effortlessly generate Swagger documentation for your Express.js API. Here’s a quick recap:</p><p>You can get the complete example on github H<a href="https://github.com/davibaltar/example-swagger-autogen">ere</a>.</p><h3>Install Required Dependencies:</h3><p>Install <a href="https://swagger-autogen.github.io/docs/">swagger-autogen</a> by running the following command. This package is used to generate Swagger documentation from your code automatically. for detail understanding checkout its documentation <a href="https://swagger-autogen.github.io/docs/">here</a>.</p><pre>npm install --save-dev swagger-autogen</pre><p>Next, install swagger-ui-express by running the following command. This package provides a user-friendly interface to access and explore the Swagger documentation.</p><pre>npm install swagger-ui-express --save</pre><p>Create a file in your project’s root directory named `swagger.js` and populate it with the provided code. This code serves as a configuration to generate Swagger documentation for your API. The resulting documentation file will be named `swagger-output.json`, and the generator will explore routes specified in the `app.js` file. This setup simplifies the process of documenting your API, providing essential information such as the API’s title, description, and host details.</p><pre>const swaggerAutogen = require(&#39;swagger-autogen&#39;)();<br><br>const doc = {<br> info: {<br>// name of your api<br>  title: &#39;My API&#39;,<br>  description: &#39;Description&#39;<br> },<br> host: &#39;localhost:5000&#39;<br>};<br><br>const outputFile = &#39;./swagger-output.json&#39;;<br>// assuming your routes are located in app.js<br>const routes = [&#39;./app.js&#39;];<br>swaggerAutogen(outputFile, routes, doc);</pre><p>In your package.json file, add the following scripts section:</p><pre>&quot;scripts&quot;: {<br>    &quot;swagger&quot;: &quot;node ./swagger.js&quot;<br>  }</pre><p>This script configuration allows you to run the Swagger documentation generation by executing the command npm run swagger in your terminal. It invokes the node ./swagger.js command, pointing to the swagger.js file where the Swagger documentation configuration is set up. This integration streamlines the process, making it convenient to generate and update your API documentation.</p><pre>npm run swagger</pre><p>In your app.js file, add the following code to integrate Swagger UI and display the automatically generated documentation.</p><pre><br>const swaggerUi = require(&#39;swagger-ui-express&#39;)<br>const swaggerFile = require(&#39;./swagger-output.json&#39;)<br><br>app.use(&#39;/doc&#39;, swaggerUi.serve, swaggerUi.setup(swaggerFile))</pre><p>Congratulations! You have now integrated Swagger UI into your Express.js application. After running your application, you can access the automatically generated documentation by visiting the /doc endpoint. For example, if your application is running on localhost with port 5000, the documentation will be available at this <a href="http://localhost:5000/doc">link</a>.</p><p>Thank you for exploring this guide on automating Swagger documentation for your Express.js API. If you found it helpful, follow for more insights on simplifying development tasks. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd3c6a431c36" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/automatic-api-documentation-for-express-js-using-swagger-bd3c6a431c36">Automatic API Documentation for Express.js Using Swagger</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[Node.js vs. Django: Building Secure APIs Like a Backend Ninja]]></title>
            <link>https://medium.com/@Barnaan/node-js-vs-django-building-secure-apis-like-a-backend-ninja-3c6325f1894d?source=rss-2d09cd18f88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c6325f1894d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Bernabas Tekkalign]]></dc:creator>
            <pubDate>Thu, 01 Feb 2024 06:15:42 GMT</pubDate>
            <atom:updated>2024-02-01T06:15:42.528Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gwo3-WWgHvunFK2QXba1EQ.jpeg" /></figure><p>Ever break out in a cold sweat worrying about your backend APIs’ security? Join the club! Choosing between Node.js and Django for this crucial task can feel like navigating a security minefield. But fear not, fellow ninjas! Today, we’ll dissect the strengths of each framework in two key security scenarios: fortressing financial data like a bank vault (Django’s domain) and fast through real-time e-commerce transactions (Node.js’ playground).</p><p>My Django Journey (and Node.js Flirting):<br>As a seasoned Django developer, I once swore by Django REST framework for APIs. But curiosity, that developer’s best friend, led me to Node.js and Express. Let me tell you, it was love at first line of code! However, i was always bothered: when to choose one over the other, especially for security?</p><p>Forget generic “it depends” answers. Let’s dive into specific scenarios and see which framework shines brightest:</p><h4>Scenario 1</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7L2aaFxpOcQBN8mG4bR5qg.png" /><figcaption>image that shows bank system</figcaption></figure><h4>Securing Fort Knox APIs for Banking Systems</h4><ol><li><strong>Authentication &amp; Authorization</strong>: Django takes the lead with built-in user management and permission classes. Think rock-solid vaults secured by digital padlocks.</li><li><strong>Data Security</strong>: Encryption at rest and in transit? Django’s got you covered, keeping sensitive financial data under multiple layers of protection</li><li><strong>Vulnerability Management</strong>: Django’s mature community and well-maintained libraries mean fewer security surprises, like finding a rusty keyhole in your vault.<br><em>Node.js, however, isn’t out of the picture:</em></li><li><strong>Flexibility</strong>: for integrating custom authentication protocols or niche security libraries, Node.js offers the freedom to tailor security to your specific needs.</li><li><strong>Performance</strong>: High-volume transactions? Node.js’ asynchronous nature can handle them like a ninja dodging laser beams, potentially outperforming Django in some scenarios.(but now remember we focusing on security).</li></ol><h4>Scenario 2</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6nYUC085BvnAPVPAEYdDag.jpeg" /><figcaption>Image that shows eCommerce platform.</figcaption></figure><h4>Blazing Fast E-commerce APIs</h4><ol><li><strong>Real-time Transactions</strong>: Node.js excels here, with its event-driven architecture handling rapid-fire requests like a ninja’s flurry of punches. Perfect for processing orders and updating inventories in real-time.</li><li><strong>Scalability</strong>: E-commerce traffic spikes? Node.js’ ability to easily scale horizontally can handle it, like a ninja army multiplying to meet any threat.</li><li><strong>Lightweight Framework</strong>: Node.js’ smaller footprint can mean faster development cycles, ideal for keeping up with the ever-evolving e-commerce landscape.<br><em>But Django isn’t just watching:</em></li><li><strong>Data Consistency</strong>: Need to ensure accurate product information across platforms? Django’s strong data models and relationships come in handy, like a ninja’s meticulous attention to detail.</li><li><strong>Security Auditing</strong>: Django’s established community provides readily available security auditing tools, helping you identify and patch vulnerabilities before they become problems.<br>The Takeaway:</li></ol><p>Choosing between Node.js and Django for secure APIs is a nuanced dance. Django shines for secure, established fortresses like banking systems, while Node.js excels in fast-paced, adaptable environments like e-commerce. Ultimately, the right framework depends on your specific security needs(like all the other blogs says😊), project requirements, and development preferences.</p><p><em>Remember, fellow ninjas:</em></p><p>Security is an ongoing process, not a one-time choice. Continuously assess vulnerabilities and update your APIs with the latest security best practices.<br>Community matters. Leverage the wealth of knowledge and resources available for both frameworks to keep your APIs secure and robust.<br>Don’t be afraid to experiment! Both Node.js and Django offer incredible flexibility, so test, tweak, and find the perfect security solution for your unique project.<br>Now, go forth and build secure APIs that would make any ninja proud! And don’t forget to share your thoughts and experiences in the comments below. and if you like it don’t forget to share it.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c6325f1894d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elevate Your Backend Game: Crafting World-Class Systems with Django]]></title>
            <link>https://medium.com/@Barnaan/elevate-your-backend-game-crafting-world-class-systems-with-django-f5b70b2d8b43?source=rss-2d09cd18f88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5b70b2d8b43</guid>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[django-rest-framework]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Bernabas Tekkalign]]></dc:creator>
            <pubDate>Thu, 31 Aug 2023 23:25:26 GMT</pubDate>
            <atom:updated>2023-09-01T23:26:57.152Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q-FqYf9tTJHX4c3u9JMHqQ.png" /><figcaption>crafting world class systems with django</figcaption></figure><p>When you set out to create the hidden part of big websites or platforms, it sounds like an exciting adventure. You’re putting together the stuff that makes everything work, like the <strong>engine of a car</strong>. But as you add more and more functionalities , it can start to feel like a puzzle getting too complex. You might feel like you’re stuck in a loop, not sure what to do next. But don’t worry, I’m here to show you a way to make it easier.</p><p><em>Let’s imagine you’re in a jungle</em>, just like the one in movies. At first, the trees and paths are clear, and it’s all good. But as you go deeper, things start to get fuzzy and confusing. That’s what happens when you’re working on your project’s backend . So, I want to share a plan that can help you tame this jungle and make your project amazing.</p><h3><strong>1. Building the Beginning: Making the Base</strong></h3><p>Imagine starting from the very start, like building the bottom of a tower. We begin with “Making the Base.” Picture Django as the toolbox that helps put the pieces together for making websites and stuff. The success of your entire website is depends on how much you spent on structuring the base. The bases are : File structure, Database connectivity and other basic operations.</p><pre># Set up the framework<br># These are an example of making the base with django.<br>from django.urls import path<br>from . import views<br><br>urlpatterns = [<br>    path(&#39;home/&#39;, views.home),<br>    # More routes here<br>]</pre><h3><strong>2. Secret Codes: Making Safe Logins</strong></h3><p>Secondly we have think about passwords and locks “Making Safe Logins” is like giving secret codes. This stage helps give the right codes to the right people, so only they can come into the special parts of your website and use the specified functionalities.</p><pre># User authentication<br># example of simple making safe logins with django.<br>from django.contrib.auth import authenticate, login<br><br>user = authenticate(username=&#39;username&#39;, password=&#39;password&#39;)<br>if user is not None:<br>    login(request, user)</pre><h3>3. Who’s the Boss: Deciding the Roles (Authorization)</h3><p>Imagine a group where everyone does different things. This is where the boss steps in to decide who does what. It’s like having roles in a play — who’s the main character, who’s the sidekick, you know. When it comes to websites, it’s called “Authorization,” and it’s like being the boss and telling who can do what.</p><p>Django makes this easy. It helps you assign roles, like saying who’s the captain, who’s the helper, and so on. Just like in a movie, not everyone can be the hero, but each role is important for the story to work. With Django, you can make sure the right people have the right permissions. It’s like having a backstage pass to control who enters different parts of your website.</p><p>So, with Django as your director, you can decide who plays what role in your digital show.</p><pre># Assigning user roles and permissions<br>from django.contrib.auth.models import User, Group, Permission<br><br>user = User.objects.get(username=&#39;username&#39;)<br>group = Group.objects.get(name=&#39;group_name&#39;)<br>user.groups.add(group)</pre><h3><strong>4. Smoothing Things Out: Making It Nice</strong></h3><p>Imagine your creation like a car — you wanna make sure it runs smooth, right? “Making It Nice” is about making sure it all works good. making sure everything runs well</p><pre># Optimizing queries for better performance example with django<br>from django.db import models<br><br>class Blog(models.Model):<br>    title = models.CharField(max_length=200)<br>    content = models.TextField()<br><br>    def __str__(self):<br>        return self.title</pre><h3><strong>5. Adding the Cool Stuff: Doing More</strong></h3><p>Now, let’s dive into the exciting phase of elevating your creation — “Doing More.” Think of it as adding unique decorations to your digital room, making it truly your own. This step is like an artist adding vibrant colors to a canvas, breathing life into your project. Just as a playground becomes more fun with swings and slides, this is where you infuse your creation with cool features that bring it to life.</p><p>Imagine you’re building a website or app, and you want users to leave comments, share content, or engage in lively chats. These special touches make your project dynamic and engaging. And the best part? You don’t have to do it all from scratch. Much like a team of skilled craftsmen, you can collaborate with other tools that offer ready-made features. These tools act like magic dust, adding an extra sparkle to your project.</p><p>In the realm of website and app development, the possibilities are vast. From interactive forms to user authentication, chat features, and multimedia integration, you have a treasure trove of options for “Doing More.” Imagine your project as an art studio where your creativity knows no bounds. With the right tools and a dash of imagination, you’re on the path to crafting a digital masterpiece that stands out in the online landscape.</p><pre># Example of creating comment model with django. <br>from django.db import models<br>from django.contrib.auth.models import User<br><br>class Comment(models.Model):<br>    user = models.ForeignKey(User, on_delete=models.CASCADE)<br>    text = models.TextField()<br>    created_at = models.DateTimeField(auto_now_add=True)<br><br>    def __str__(self):<br>        return f&#39;Comment by {self.user.username}&#39;</pre><h3>6. Learning and Evolving: Your Path to Improvement</h3><p>Imagine embarking on a journey of growth, learning from those who’ve walked the path before you. “Becoming Better” is about progress and learning. With Django, it’s like having friends who share tips and ideas, helping you improve. Embrace this phase as an opportunity to expand your knowledge, gather insights, and develop skills that lead to continuous advancement. Just as a community thrives when members support each other, your journey flourishes with the collective wisdom of peers. Embrace the power of “Becoming Better,” backed by the support of Django and a community eager to uplift your progress.</p><h3><strong>7. Documenting Progress: Recording and Sharing</strong></h3><p>Imagine having a diary where you note down your findings. “Documenting and Notes” is about jotting down what you learn. With Django, you can preserve and share your insights for others to benefit.</p><p>In the development world, <strong>testing</strong> ensures your project works correctly. For example, in a Django web app, you’d test buttons and forms to catch errors early and guarantee smooth functionality.</p><p><strong>Documentation</strong> acts like a user manual. It guides users on how to interact with your creation. Likewise, for teams, clear documentation ensures seamless collaboration.</p><p>In Django, you can write tests using the built-in TestCase class:</p><pre>from django.test import TestCase<br>from django.urls import reverse<br><br>class MyViewTest(TestCase):<br>    def test_view_response(self):<br>        response = self.client.get(reverse(&#39;my_view_name&#39;))<br>        self.assertEqual(response.status_code, 200)<br>        self.assertTemplateUsed(response, &#39;my_template.html&#39;)</pre><h3><strong>8. Crafting Neat Code: The Art of Readability</strong></h3><p>Picture clean up your room for a fresh look — that’s the feeling of organizing your code. “Crafting Neat Code” is all about enhancing the appearance of your code. It’s like cleaning up for better readability. Regardless of your tech choice, adhering to clean coding practices simplifies the process.</p><p>Just like arranging furniture for a harmonious setup, well-structured code is a joy to read and maintain. Consistent indentation, meaningful variable names, and clear comments contribute to the visual appeal. When code is neat, anyone who comes across it can easily understand and build upon it.</p><p>Imagine, for instance, you’re creating a function in Python:</p><pre>def calculate_area(length, width):<br>    &quot;&quot;&quot;<br>    Calculate the area of a rectangle.<br>    Args:<br>        length (float): The length of the rectangle.<br>        width (float): The width of the rectangle.<br>    Returns:<br>        float: The calculated area.<br>    &quot;&quot;&quot;<br>    area = length * width<br>    return area</pre><h3><strong>9. Collaborating Effectively: Sharing Insights and Aiding</strong></h3><p>Envision friends assisting you in solving a complex puzzle. “Collaborating and Assisting” is the essence of working together. It’s like having a conversation with peers who offer valuable insights. Irrespective of the technology used, effective collaboration enhances problem-solving.</p><p>Much like combining pieces of a jigsaw puzzle, teamwork involves connecting individual contributions to form a cohesive whole. Django serves as a channel for interaction, connecting you with knowledgeable individuals who can provide guidance, suggestions, and solutions.</p><p>Imagine you’re working on a coding challenge, and you’re unsure about a particular approach:</p><pre># You need help with this part of the code<br>def solve_challenge(problem):<br>    &quot;&quot;&quot;<br>    Solve a coding challenge.<br>    Args:<br>        problem (str): The problem statement.<br>    Returns:<br>        str: The solution to the challenge.<br>    &quot;&quot;&quot;<br>    # Need guidance on the next steps<br>    solution = &quot;Work in progress&quot;<br>    return solution</pre><h3><strong>10. Expanding Horizons: Continuous Growth</strong></h3><p>Envision an endless story that keeps unfolding. “Expanding Horizons” is the journey of making things bigger. Much like a never-ending tale, with Django, you continuously enhance and introduce new elements, crafting a narrative that evolves ceaselessly.</p><p>Think of it as building upon a foundation, layer by layer. Just as a writer adds new chapters to a story, you’re consistently improving and extending your creation. This philosophy transcends specific technologies, embracing the essence of continuous development.</p><p>Thank you so much for taking the time to read through these thoughts on backend development. I really hope you found these ideas helpful as you continue on your development journey. If you’re interested in learning more about technology and development strategies, please consider following me for more content. Let’s also connect on LinkedIn here at<a href="https://www.linkedin.com/in/bernabas-tekkalign-4b1116232/"> Bernabas Tekkalign</a> so we can keep sharing our passion for growth and innovation. Looking forward to connecting with you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5b70b2d8b43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elevate Your Django Skills: 10 Essential Packages for Next-Level Web Applications With Django.]]></title>
            <link>https://awstip.com/elevate-your-django-skills-10-essential-packages-for-next-level-web-applications-with-django-eec2326b0c02?source=rss-2d09cd18f88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/eec2326b0c02</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Bernabas Tekkalign]]></dc:creator>
            <pubDate>Wed, 24 May 2023 11:12:59 GMT</pubDate>
            <atom:updated>2023-09-05T17:37:25.462Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*y7AU62qSh07_EVVKyhc_Xw.png" /><figcaption>top 10 Django packages.</figcaption></figure><p>Welcome to the world of Django, where web development becomes an adventure! In this article, we’ll explore 10 essential Django packages that will empower developers like you to create powerful and feature-rich web applications. We’ll dive deeper into each package, explain their key functionalities, and provide a step-by-step installation guide. So, grab your keyboard and sit tight as we uncover the secrets of these must-have Django packages!</p><ol><li><strong>Django Debug Toolbar:</strong> Uncover hidden insights in your Django application with the indispensable Django Debug Toolbar. This powerful package provides a visual interface for debugging, offering detailed information about requests, SQL queries, and performance metrics. With the Debug Toolbar, you can optimize your code, identify bottlenecks, and gain valuable insights into your application’s performance. Use the following command to install the package.</li></ol><pre>pip install django-debug-toolbar</pre><p>2.<strong>Django Rest Framework</strong>: This comprehensive package simplifies the creation of RESTful APIs, providing robust tools for serialization, authentication, and permissions. Django Rest Framework allows you to build scalable and flexible APIs that follow industry best practices, supporting various data formats and handling complex data relationships effortlessly. Can be easily installed using the command below.</p><pre>pip install djangorestframework</pre><p>3. <strong>Celery:</strong> Celery is useful for asynchronous processing and background tasks. This powerful distributed task queue enables you to delegate time-consuming operations outside the typical request-response flow, ensuring a highly responsive Django application. With Celery, you can handle resource-intensive tasks, schedule periodic tasks, and achieve parallel processing, improving performance and scalability. For installation use the command below.</p><pre>pip install celery</pre><p>4. <strong>Django-Crispy-Forms:</strong> Simplify form building with the elegant Django-Crispy-Forms package. This handy tool streamlines the process of rendering and styling forms, offering customizable layouts and crisp form rendering. Django-Crispy-Forms reduces the time and effort required to create visually appealing and user-friendly forms, enhancing the overall user experience of your application.For installation use the command below.</p><pre>pip install django-crispy-forms</pre><p>5. <strong>Django-Cache</strong>: Boost your Django application’s performance with Django-Cache, a powerful caching framework. This package allows you to store frequently accessed data in memory, reducing the need for repetitive database queries. By implementing caching, you can significantly improve response times and alleviate database load, resulting in a more efficient and scalable application.</p><pre>pip install django-cache</pre><p>6.<strong> Django Allauth:</strong> This package offers a comprehensive set of features for user registration, login, and account management. With Django Allauth, you can integrate social authentication, email verification, and multi-factor authentication seamlessly into your application, providing a secure and user-friendly authentication experience.</p><pre>pip install django-allauth</pre><p>7. <strong>Django Guardian:</strong> Django Guardian is useful for Enhancing the fine-grained authorization capabilities of Django application . This package allows you to manage object-level permissions, enabling you to define access control for individual model instances. Django Guardian provides a flexible and easy-to-use API, giving you granular control over who can access specific resources within your application.</p><pre>pip install django-guardian</pre><p>8.<strong>Django Storages:</strong> Simplify file management and storage in your Django application with Django Storages. This package offers seamless integration with popular cloud storage providers, such as Amazon S3 and Google Cloud Storage. Django Storages allows you to store and retrieve files efficiently, providing scalability and durability for your application’s assets.</p><pre>pip install django-storages</pre><p>9. <strong>Django Compressor: </strong>Django Compressor is used for Improving the performance of Django application by optimizing and bundling static files. This package automatically combines and compresses CSS and JavaScript files, reducing the number of HTTP requests and improving page load times. Django Compressor makes it easy to manage static assets and deliver them efficiently to users.</p><pre>pip install django-compressor</pre><p>10.<strong>Django Haystack:</strong> last but not least is Haystack which is used for powerful search functionality . This package integrates various search engines, such as Elasticsearch and Solr, allowing you to build robust search capabilities for your application. Django Haystack provides an intuitive API for indexing and querying data, enabling users to perform fast and accurate searches.</p><pre>pip install django-haystack</pre><p>By incorporating these 10 essential Django packages into your web development Toolbox, you’ll equip yourself with the tools necessary to build powerful, secure, and efficient web applications.</p><p>Thanks for reading. If you like the article share it with your friends.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eec2326b0c02" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/elevate-your-django-skills-10-essential-packages-for-next-level-web-applications-with-django-eec2326b0c02">Elevate Your Django Skills: 10 Essential Packages for Next-Level Web Applications With Django.</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[5 Essential JavaScript Security Best Practices to Protect Your Applications]]></title>
            <link>https://medium.com/@Barnaan/5-essential-javascript-security-best-practices-to-protect-your-applications-910c6f63b833?source=rss-2d09cd18f88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/910c6f63b833</guid>
            <dc:creator><![CDATA[Bernabas Tekkalign]]></dc:creator>
            <pubDate>Wed, 24 May 2023 10:06:45 GMT</pubDate>
            <atom:updated>2023-05-24T10:06:45.199Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yE3YBTVM4OWqqOaymkvgiw.png" /><figcaption>security image.</figcaption></figure><p>JavaScript is a widely used language for web development, but it’s crucial to prioritize security to protect your applications and users. In this article, we’ll discuss five essential JavaScript security best practices that will help you protect your applications from common vulnerabilities.</p><ol><li><strong>Prevent Cross-Site Scripting (XSS) Attacks</strong>: Learn how to validate and sanitize user input, implement Content Security Policy (CSP), and apply proper output encoding to prevent malicious code injection and protect against XSS attacks.</li><li><strong>Mitigate Injection Attacks</strong>: Protect your applications from injection attacks, such as SQL injection, by utilizing parameterized queries or prepared statements, and validating and sanitizing user input to prevent unauthorized access to your data.</li><li><strong>Guard Against Cross-Site Request Forgery (CSRF):</strong> Implement measures like using CSRF tokens, validating requests, and checking request origins to prevent CSRF attacks, which exploit the trust between a user’s browser and your application.</li><li><strong>Secure Direct Object References</strong>: Ensure that sensitive information is not exposed by properly validating and authorizing object references, implementing secure access controls, and checking user permissions to prevent unauthorized access to data or resources.</li><li><strong>Strengthen Authentication and Authorization</strong>: Implement secure authentication practices, including strong password hashing algorithms like bcrypt. Utilize token-based authentication for APIs, enforce secure password policies, and implement proper session management to prevent unauthorized access.</li></ol><p>Congratulations on surviving this epic JavaScript security quest! You’ve unlocked five powerful defense techniques to shield your applications from cyber havoc. But hold your nerdy hats, because we’ve barely skimmed the surface of this security galaxy. Consider these tips your trusty code guardians, warding off digital evil with the strength of a thousand firewalls. Remember, the security realm is an ever-changing battlefield, so stay curious, level up your knowledge, and embrace the thrilling journey of protecting your JavaScript creations.<em>may your code be as secure as an unbreakable encryption algorithm guarded by a geeky AI-powered cyborg!</em></p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=910c6f63b833" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Django processes an ORM query?]]></title>
            <link>https://medium.com/@Barnaan/how-django-processes-an-orm-query-f2316c95b?source=rss-2d09cd18f88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2316c95b</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[python-django-developer]]></category>
            <category><![CDATA[django-orm]]></category>
            <category><![CDATA[django-framework]]></category>
            <category><![CDATA[django-rest-framework]]></category>
            <dc:creator><![CDATA[Bernabas Tekkalign]]></dc:creator>
            <pubDate>Tue, 21 Mar 2023 18:45:18 GMT</pubDate>
            <atom:updated>2023-03-22T07:22:14.423Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="django web framework" src="https://cdn-images-1.medium.com/max/381/1*WD6Med_m8h_S-77N2dS6fQ.png" /><figcaption>Django logo</figcaption></figure><p>Most often developers focus on writing code that works as they expected and if it does so , they don’t bother why and how. While using frameworks like Django you could build complex projects without understanding what is happening behind the scene but to develop efficient , simple and understandable project its essential to have a basic understanding of how stuff works.Here i will be discussing how Django do the magical ORM query processing behind the scene.</p><h3>What is an ORM ?</h3><p>ORM stands for Object-Relational Mapping. It is a technique used to map data from a relational database to object-oriented programming languages, such as Python.ORM allows developers to interact with a database using objects and methods, rather than writing SQL queries directly. It abstracts the details of the database structure away from the application code and provides a higher-level interface to work with the data. which makes it so easy for the developers to interact with data.</p><h3>Why do we need ORM ?</h3><p>There are several reasons why we need ORM in Django :</p><ol><li><strong>Object-Oriented Programming:</strong> Object-oriented programming (OOP) is a popular programming paradigm in modern software development. OOP provides many benefits, such as code reuse, encapsulation, and abstraction. ORM helps bridge the gap between the object-oriented programming model and the relational data model used in most databases.</li><li><strong>SQL Abstraction:</strong> ORM provides an abstraction layer between the application code and the underlying database. This abstraction simplifies the application code, making it more readable and maintainable. Developers don’t have to write low-level SQL queries or deal with database-specific details.</li><li><strong>Portability:</strong> ORM makes the application more portable. By using an ORM, developers can write code that is not tied to a specific database vendor or implementation. The ORM can generate database-specific SQL code, which means that the application can work with different databases without changes to the application code.</li><li><strong>Efficiency:</strong> ORM can improve the efficiency of application code. ORM frameworks often include caching, query optimization, and other performance-enhancing features that can make database interactions faster and more efficient.</li><li><strong>Security</strong>: ORM can help improve the security of the application. ORM frameworks provide features such as data validation, prepared statements, and parameterized queries, which can help prevent SQL injection attacks and other security vulnerabilities.</li></ol><p>In general , ORM simplifies the development of database-driven applications, making it easier for developers to write efficient, maintainable, and secure code.</p><h3>How does Django ORM really works ?</h3><p>Since we have discussed the common terms, so we will be proceeding to the main topic. “How Django processes an ORM query “.</p><p>When you use Django’s ORM (Object-Relational Mapping) to query a database, Django translates your query into a SQL statement that can be executed by the database. Here’s an overview of the process:</p><figure><img alt="ORM query Processing steps visualized ." src="https://cdn-images-1.medium.com/max/444/1*NNR5nqynhOYPoRm3NCBQkw.png" /></figure><ol><li><strong>Model Definition:</strong> First, you define your data models using Python classes. Each model represents a database table, and the attributes of the model correspond to the columns in the table.</li><li><strong>Query Generation: </strong>When you use the ORM to query the database, Django generates SQL code based on the query you specified. The query is typically constructed using a QuerySet object, which allows you to chain together various filters, orderings, and other operations.</li><li><strong>SQL Construction</strong>: Django uses the query generation logic to construct a SQL statement that can be executed by the database. This involves taking into account the database backend you’re using and the dialect of SQL it understands.</li><li><strong>Query Execution:</strong> Once the SQL statement is generated, Django sends it to the database to execute the query. The results of the query are returned to Django, typically in the form of a list of model instances.</li><li><strong>Object Instantiation:</strong> Finally, Django instantiates Python objects based on the rows returned from the database. These objects correspond to the models you defined in step 1, and each attribute of the object corresponds to a column in the database table.</li></ol><p>In addition to the basic query operations, Django’s ORM also supports more advanced operations like aggregation, annotation, and complex joins. These operations allow you to perform complex data analysis and manipulation using simple Python code, without having to write SQL code directly.</p><p>Generally , Django’s ORM provides a powerful and flexible way to interact with databases using Python. By abstracting away the details of SQL and database interactions, Django allows you to focus on writing high-level code that is more readable, maintainable, and scalable.</p><p>Thanks for reading ! Follow me for more content like this one .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2316c95b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use UUID (Universally Unique Identifiers) in Django?]]></title>
            <link>https://medium.com/@Barnaan/how-to-use-uuid-universally-unique-identifiers-in-django-91eafb6fbc44?source=rss-2d09cd18f88d------2</link>
            <guid isPermaLink="false">https://medium.com/p/91eafb6fbc44</guid>
            <dc:creator><![CDATA[Bernabas Tekkalign]]></dc:creator>
            <pubDate>Thu, 10 Nov 2022 20:06:34 GMT</pubDate>
            <atom:updated>2023-02-22T06:35:27.726Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>What is UUID?</strong></h3><p><strong>Universally Unique Identifiers</strong>, or UUIDS, are 128 bit numbers, composed of 16 octets and represented as 32 base-16 characters, that can be used to identify information across a computer system. using UUID for your project can make your site more professional and reliable because of that for the most part ID of your resources are not humanly guessable also its unique from any other resource’s ID in the internet.</p><h3>How to use UUID in Django ?</h3><p>Django by default Utilize an integer ID which starts from 1 and increases as much as your database’s table row goes. This can be good enough for development purpose but in production its not a good practice. its recommended to use UUID.</p><p>To use UUID in your model there is only two steps to follow :</p><ol><li>Import the built in UUID module</li><li>override default Django id with your UUID field.</li></ol><p><strong>See the following code example of Django model with UUID:</strong></p><pre>from django.db import models<br><br>class Product(models.model):<br>      name = models.Charfield(max_length=100)   <br>      price = models.FloatField()<br>      created_at = models.DateTimeField(auto_now_add = True)<br>      updated = models.DateTimeField(auto_now = True)<br>      <br></pre><p><strong>See the above Django model with UUID id field:</strong></p><pre>from django.db import models<br>import uuid<br><br>class Product(models.model):<br>      name = models.Charfield(max_length=100)   <br>      price = models.FloatField()<br>      id = models.UUIDField(default=uuid.uuid4, unique=True,<br>          primary_key=True, editable=False)<br><br>      created_at = models.DateTimeField(auto_now_add = True)<br>      updated = models.DateTimeField(auto_now = True)<br>      <br>   </pre><p>So by using the above two lines of code you can easily add UUID instead of the default Django’s Integer ID field.</p><p>Thanks for reading! Follow me for related topics</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91eafb6fbc44" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>