<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Making AI Frictionless with Melio AI &#x1f680;</title>
    <link>https://pages.melio.ai/insights</link>
    <description>Explore the cutting-edge of AI and Data Science with our expert insights on AI/ML, MLOps, LLMOps, Generative AI, and DataOps. Stay ahead of the curve with tutorials, industry analyses, and the latest trends in machine learning operations. Whether you're a seasoned professional or just starting out, our blog is your go-to resource for all things AI and data science.</description>
    <language>en-gb</language>
    <pubDate>Tue, 15 Sep 2026 18:22:20 GMT</pubDate>
    <dc:date>2026-09-15T18:22:20Z</dc:date>
    <dc:language>en-gb</dc:language>
    <item>
      <title>Accelerating AI/ML Value: Transforming Investment to Impact</title>
      <link>https://pages.melio.ai/insights/ai-time-to-value</link>
      <description>&lt;div class="hs-featured-image-wrapper"&gt; 
 &lt;a href="https://pages.melio.ai/insights/ai-time-to-value" title="" class="hs-featured-image-link"&gt; &lt;img src="https://pages.melio.ai/hubfs/Imported_Blog_Media/cover-3.webp" alt="Accelerating AI/ML Value: Transforming Investment to Impact" class="hs-featured-image" style="width:auto !important; max-width:50%; float:left; margin:0 15px 15px 0;"&gt; &lt;/a&gt; 
&lt;/div&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Explore how to derive business impact, competitive advantage, and enhanced decision-making from AI/ML, and learn how to tackle the common challenges in achieving rapid time-to-value.&lt;/p&gt; 
&lt;/blockquote&gt;   
&lt;h6&gt;Photo by GPT4-vision.&lt;/h6&gt;   
&lt;p&gt;In today’s business landscape, the race to leverage AI and ML for competitive advantage is more intense than ever. But here’s the million-dollar question: how do businesses translate AI/ML investments into tangible value swiftly and effectively?&lt;/p&gt; 
&lt;h2&gt;But… what is Value?&lt;/h2&gt; 
&lt;p&gt;Many companies face financial limitations that prevent them from undertaking costly and uncertain data science projects. Consequently, shortening the time to achieve value is a critical goal for data science leaders.&lt;/p&gt; 
&lt;p&gt;However, the concept of “value” needs clarification &#x1f50d;.&lt;/p&gt; 
&lt;p&gt;Typically, “value” refers to whether there is a willingness to pay for a particular AI model, data pipeline, or set of features. In the context of AI/ML, reducing the time to value means quickly deriving benefits from data and analytics.&lt;/p&gt; 
&lt;p&gt;AI can deliver value in three main forms:&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;1️⃣ Business Impact (typically measured in financial terms):&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;To generate a positive business impact, companies should target manual and repetitive tasks that can be resolved by humans in less than five seconds. These tasks are ideal for AI automation, leading to cost savings and efficiency improvements.&lt;/p&gt; 
&lt;p&gt;&#x1f4b0; Example: A bank implementing an AI platform that uses NLP to review and interpret commercial loan agreements, saving 360,000 hours of lawyer costs annually.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;2️⃣ Competitive Advantage (e.g., market share, customer retention):&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;To enhance competitive advantage, companies can implement AI to differentiate their products or services, improve customer experience, and innovate faster than rivals, thereby gaining market share and enhancing customer loyalty.&lt;/p&gt; 
&lt;p&gt;&#x1f310; Example: An online learning platform employing AI-driven learning assistants to help students study more effectively. The Q&amp;amp;A style and automated assessments enhanced student engagement and boosted retention.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;3️⃣ Enhanced Decision Making (measured by time saved):&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;To boost decision-making processes, companies can leverage AI to provide faster, data-driven insights, reducing the time spent on analysis and enabling quicker, more informed decisions.&lt;/p&gt; 
&lt;p&gt;⏰ Example: A hospital group analyses patient care data and prioritises nursing tasks within the hospital to reduce hospital-acquired infections.&lt;/p&gt; 
&lt;p&gt;Achieving value more rapidly leads to improved decision-making, enhanced efficiency, and maintaining a competitive edge in the marketplace. Therefore, the ability to swiftly identify use cases and extract value from data science initiatives is essential for companies to thrive in today’s competitive environment.&lt;/p&gt; 
&lt;p&gt;However, the journey isn’t always straightforward. Various challenges related to business strategies, processes, technology, and data can impede AI/ML projects. To truly accelerate AI adoption successfully, it’s crucial to recognize these potential obstacles early on and develop strategic approaches to overcome them.&lt;/p&gt; 
&lt;h2&gt;Challenge 1: Business&lt;/h2&gt; 
&lt;p&gt;Addressing business challenges is essential and should be the first step before starting any AI initiatives. After all, without a supportive sponsor, there will be no budget or end-users for the application. Here are the three most frequently encountered business challenges:&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f469;‍&#x1f4bc; Lack of business involvement:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;The success of a project hinges on active engagement from business stakeholders. When this participation is lacking, there’s a significant risk of developing solutions that do not align with the broader organisational goals. Receiving constructive business feedback shows a clear interest and value in what is being created and should be treasured and embraced.&lt;/p&gt; 
&lt;p&gt;Example: A bank implements an AI-powered credit scoring model without adequate input from business leaders. The model, while capable of analysing vast amounts of data to assess credit risk, may overlook crucial factors specific to the bank’s customer base and lending policies.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f4ca; No baseline to compare to:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Without a well-defined baseline, the actual impact of an AI solution may be unclear. Demonstrating the value of an AI solution involves showing improvements over the current method. If you can’t measure the improvement quantitatively, it becomes challenging to show tangible value and support the implementation of the new approach. A baseline allows you to quantify ROI easily, clarifying business investments in ML projects.&lt;/p&gt; 
&lt;p&gt;Example: An AI-based medical image diagnosis requires a baseline accuracy rate of a radiologist’s diagnoses to compare against the existing process. Without this baseline, it’s challenging to accurately assess the effectiveness of the model and justify its integration into clinical practice.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f504; Short-term thinking:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;While quick wins are enticing, overemphasising short-term gains without considering long-term scalability and adaptability can lead to the accumulation of technical debt. Striking a balance between immediate results and a strategic, long-term perspective is important for sustaining the success of ML projects.&lt;/p&gt; 
&lt;p&gt;Example: A machine learning model for customer churn prediction can result in technical debt due to hard-coding design components and minimal documentation. This can result in significant refactoring and cost especially if key people leave the team.&lt;/p&gt; 
&lt;h2&gt;Challenge 2: Process&lt;/h2&gt; 
&lt;p&gt;Process challenges are often the most difficult to address because they require altering established human behaviors. However, no AI initiative can succeed without solid processes for implementation, maintenance, and oversight. Here are the three main process challenges that frequently hinder AI projects.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f50d; Data &amp;amp; Model Governance:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Effective governance is critical in managing data and AI models. Inadequate governance can lead to biased outcomes, raise ethical issues, and obscure decision-making processes in models. Furthermore, neglecting governance until the late stages of the development cycle often obstructs project completion.&lt;/p&gt; 
&lt;p&gt;Example: A financial institution’s credit scoring model reinforcing biases in historical data could result in discriminatory lending practices.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f91d; Lack of cross-functional teams:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;The collaboration between domain experts, engineering teams, and data scientists is crucial for successful ML projects to be developed, deployed, and operationalised. When cross-functional teams are absent, there is a risk of disjointed efforts, hindering effective problem-solving, integration, and adaptation of machine learning solutions within the organisation’s operations.&lt;/p&gt; 
&lt;p&gt;Example: A business-driven project without data science input may have a flawed scope, while a data science-driven project lacking engineering support struggles with deployment, delaying project completion.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f4c8; Sustaining model performance:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;ML models must continuously adapt to changing data, trends, and business needs to maintain effectiveness. Failure to keep model performance at required levels can lead to degraded model accuracy, resulting in poor decision-making, increasing costs and customer churn through degraded service delivery.&lt;/p&gt; 
&lt;p&gt;Example: An outdated recommendation system in e-commerce can result in decreased sales and lost market share as it fails to reflect current consumer preferences.&lt;/p&gt; 
&lt;h2&gt;Challenge 3: Technology and Data&lt;/h2&gt; 
&lt;p&gt;AI systems are complex, combining the intricacies of standard software systems with the added challenges of large-scale data and models. This makes operationalizing AI systems a particularly tough challenge. While numerous technology and data hurdles exist, here we highlight the top three that are frequently underestimated.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f527; Data Quality and Management:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Effective data governance is essential for AI/ML projects. Challenges arise when data are poorly formatted, scattered across various sources, or of low quality. These issues can significantly compromise the accuracy of machine learning models.&lt;/p&gt; 
&lt;p&gt;Example: In a healthcare analytics project predicting patient outcomes with machine learning, the team faced data quality challenges. The dataset, sourced from multiple places, had diverse formats, incomplete entries, and inconsistent quality. These issues hindered accurate predictive modelling, risking misleading conclusions due to data noise. &#x1f3e5;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f40c; Technology Stack Inefficiencies:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Each AI/ML project often begins from scratch, leading to a lack of standardisation, duplication of efforts, and a drift in technology stacks. This makes it difficult to maintain diverging models and pipelines and presents challenges in onboarding new team members efficiently.&lt;/p&gt; 
&lt;p&gt;Example: Managing different versions of machine learning frameworks like PyTorch and TensorFlow, sometimes across on-premises and various cloud environments, can become a logistical nightmare. This fragmentation can significantly delay project timelines and increase the complexity of deployments. ⚙️&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f9e9; Maintaining Model and Pipeline Integrity:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Keeping machine learning models and their associated data pipelines consistent and up-to-date is a challenge due to the rapidly evolving nature of technology and business requirements. This can lead to discrepancies in model performance and difficulties in ensuring that the entire AI system remains coherent and aligned with current objectives.&lt;/p&gt; 
&lt;p&gt;Example: An organisation might struggle to update its sales forecasting models in line with new market conditions if its data pipelines are not designed to adapt to changes efficiently. This can result in outdated predictions and missed opportunities. &#x1f4ca;&lt;/p&gt; 
&lt;h2&gt;What then?&lt;/h2&gt; 
&lt;p&gt;Each business is unique. However, we’ve gathered some insights from working with 10+ data science teams.&lt;/p&gt; 
&lt;p&gt;1️⃣ &lt;strong&gt;Share knowledge and REUSE:&lt;/strong&gt; Sharing and reusing ML assets, as exemplified by a startup’s 30% reduction in development time, directly addresses business challenges by optimising resources and accelerating time-to-market.&lt;/p&gt; 
&lt;p&gt;On the tech side, it enhances development efficiency and ensures consistency, while in processes, it streamlines workflows and facilitates knowledge transfer. This practice offers tangible solutions to various challenges encountered in AI and ML projects.&lt;/p&gt; 
&lt;p&gt;2️⃣ &lt;strong&gt;Form a great TEAM:&lt;/strong&gt; Creating a dynamic team with a diverse skill set, as seen in a recent project transitioning seamlessly from data preprocessing to model deployment, addresses business challenges by providing comprehensive expertise.&lt;/p&gt; 
&lt;p&gt;This approach also tackles tech challenges through adaptability and fosters a culture of continuous improvement to address process challenges efficiently. &#x1f333;&lt;/p&gt; 
&lt;p&gt;3️⃣ &lt;strong&gt;Involve Business:&lt;/strong&gt; Involving stakeholders throughout development aligns solutions with user expectations, addressing business challenges by staying user-centric and market-relevant. It tackles tech challenges through adaptability and ensures effective communication, mitigating process challenges through iterative improvements. &#x1f504;&lt;/p&gt; 
&lt;p&gt;4️⃣ &lt;strong&gt;Iterative DEVELOPMENT:&lt;/strong&gt; Starting with heuristics and an MVP addresses business challenges by enabling quick market entry and iterative improvements for customer satisfaction. It tackles tech challenges through optimised model accuracy and resource-efficient development while addressing process challenges through a user-centric and agile approach. &#x1f680;&lt;/p&gt; 
&lt;p&gt;5️⃣ &lt;strong&gt;Focus on VALUE:&lt;/strong&gt; Prioritising features for a better end-user experience addresses business challenges by boosting monetisation and customer satisfaction. It tackles tech challenges through efficient resource allocation and continuous improvement while addressing process challenges by fostering user-centric development and effective decision-making. &#x1f4a1;&lt;/p&gt; 
&lt;h2&gt;Conclusion&lt;/h2&gt; 
&lt;p&gt;Finally, for every data science, machine learning, and AI use cases, always ask…&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;“Does it solve a practical problem? Does it create tangible value?”&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Remember, successful AI/ML solutions create substantial worth.&lt;/p&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Thanks for reading. If you want to know more about cloud-native tech and machine learning deployments, email us at &lt;a href="mailto:poke@melio.ai"&gt;poke@melio.ai&lt;/a&gt;.&lt;/p&gt;</description>
      <content:encoded>&lt;div class="hs-featured-image-wrapper"&gt; 
 &lt;a href="https://pages.melio.ai/insights/ai-time-to-value" title="" class="hs-featured-image-link"&gt; &lt;img src="https://pages.melio.ai/hubfs/Imported_Blog_Media/cover-3.webp" alt="Accelerating AI/ML Value: Transforming Investment to Impact" class="hs-featured-image" style="width:auto !important; max-width:50%; float:left; margin:0 15px 15px 0;"&gt; &lt;/a&gt; 
&lt;/div&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Explore how to derive business impact, competitive advantage, and enhanced decision-making from AI/ML, and learn how to tackle the common challenges in achieving rapid time-to-value.&lt;/p&gt; 
&lt;/blockquote&gt;   
&lt;h6&gt;Photo by GPT4-vision.&lt;/h6&gt;   
&lt;p&gt;In today’s business landscape, the race to leverage AI and ML for competitive advantage is more intense than ever. But here’s the million-dollar question: how do businesses translate AI/ML investments into tangible value swiftly and effectively?&lt;/p&gt; 
&lt;h2&gt;But… what is Value?&lt;/h2&gt; 
&lt;p&gt;Many companies face financial limitations that prevent them from undertaking costly and uncertain data science projects. Consequently, shortening the time to achieve value is a critical goal for data science leaders.&lt;/p&gt; 
&lt;p&gt;However, the concept of “value” needs clarification &#x1f50d;.&lt;/p&gt; 
&lt;p&gt;Typically, “value” refers to whether there is a willingness to pay for a particular AI model, data pipeline, or set of features. In the context of AI/ML, reducing the time to value means quickly deriving benefits from data and analytics.&lt;/p&gt; 
&lt;p&gt;AI can deliver value in three main forms:&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;1️⃣ Business Impact (typically measured in financial terms):&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;To generate a positive business impact, companies should target manual and repetitive tasks that can be resolved by humans in less than five seconds. These tasks are ideal for AI automation, leading to cost savings and efficiency improvements.&lt;/p&gt; 
&lt;p&gt;&#x1f4b0; Example: A bank implementing an AI platform that uses NLP to review and interpret commercial loan agreements, saving 360,000 hours of lawyer costs annually.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;2️⃣ Competitive Advantage (e.g., market share, customer retention):&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;To enhance competitive advantage, companies can implement AI to differentiate their products or services, improve customer experience, and innovate faster than rivals, thereby gaining market share and enhancing customer loyalty.&lt;/p&gt; 
&lt;p&gt;&#x1f310; Example: An online learning platform employing AI-driven learning assistants to help students study more effectively. The Q&amp;amp;A style and automated assessments enhanced student engagement and boosted retention.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;3️⃣ Enhanced Decision Making (measured by time saved):&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;To boost decision-making processes, companies can leverage AI to provide faster, data-driven insights, reducing the time spent on analysis and enabling quicker, more informed decisions.&lt;/p&gt; 
&lt;p&gt;⏰ Example: A hospital group analyses patient care data and prioritises nursing tasks within the hospital to reduce hospital-acquired infections.&lt;/p&gt; 
&lt;p&gt;Achieving value more rapidly leads to improved decision-making, enhanced efficiency, and maintaining a competitive edge in the marketplace. Therefore, the ability to swiftly identify use cases and extract value from data science initiatives is essential for companies to thrive in today’s competitive environment.&lt;/p&gt; 
&lt;p&gt;However, the journey isn’t always straightforward. Various challenges related to business strategies, processes, technology, and data can impede AI/ML projects. To truly accelerate AI adoption successfully, it’s crucial to recognize these potential obstacles early on and develop strategic approaches to overcome them.&lt;/p&gt; 
&lt;h2&gt;Challenge 1: Business&lt;/h2&gt; 
&lt;p&gt;Addressing business challenges is essential and should be the first step before starting any AI initiatives. After all, without a supportive sponsor, there will be no budget or end-users for the application. Here are the three most frequently encountered business challenges:&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f469;‍&#x1f4bc; Lack of business involvement:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;The success of a project hinges on active engagement from business stakeholders. When this participation is lacking, there’s a significant risk of developing solutions that do not align with the broader organisational goals. Receiving constructive business feedback shows a clear interest and value in what is being created and should be treasured and embraced.&lt;/p&gt; 
&lt;p&gt;Example: A bank implements an AI-powered credit scoring model without adequate input from business leaders. The model, while capable of analysing vast amounts of data to assess credit risk, may overlook crucial factors specific to the bank’s customer base and lending policies.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f4ca; No baseline to compare to:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Without a well-defined baseline, the actual impact of an AI solution may be unclear. Demonstrating the value of an AI solution involves showing improvements over the current method. If you can’t measure the improvement quantitatively, it becomes challenging to show tangible value and support the implementation of the new approach. A baseline allows you to quantify ROI easily, clarifying business investments in ML projects.&lt;/p&gt; 
&lt;p&gt;Example: An AI-based medical image diagnosis requires a baseline accuracy rate of a radiologist’s diagnoses to compare against the existing process. Without this baseline, it’s challenging to accurately assess the effectiveness of the model and justify its integration into clinical practice.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f504; Short-term thinking:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;While quick wins are enticing, overemphasising short-term gains without considering long-term scalability and adaptability can lead to the accumulation of technical debt. Striking a balance between immediate results and a strategic, long-term perspective is important for sustaining the success of ML projects.&lt;/p&gt; 
&lt;p&gt;Example: A machine learning model for customer churn prediction can result in technical debt due to hard-coding design components and minimal documentation. This can result in significant refactoring and cost especially if key people leave the team.&lt;/p&gt; 
&lt;h2&gt;Challenge 2: Process&lt;/h2&gt; 
&lt;p&gt;Process challenges are often the most difficult to address because they require altering established human behaviors. However, no AI initiative can succeed without solid processes for implementation, maintenance, and oversight. Here are the three main process challenges that frequently hinder AI projects.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f50d; Data &amp;amp; Model Governance:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Effective governance is critical in managing data and AI models. Inadequate governance can lead to biased outcomes, raise ethical issues, and obscure decision-making processes in models. Furthermore, neglecting governance until the late stages of the development cycle often obstructs project completion.&lt;/p&gt; 
&lt;p&gt;Example: A financial institution’s credit scoring model reinforcing biases in historical data could result in discriminatory lending practices.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f91d; Lack of cross-functional teams:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;The collaboration between domain experts, engineering teams, and data scientists is crucial for successful ML projects to be developed, deployed, and operationalised. When cross-functional teams are absent, there is a risk of disjointed efforts, hindering effective problem-solving, integration, and adaptation of machine learning solutions within the organisation’s operations.&lt;/p&gt; 
&lt;p&gt;Example: A business-driven project without data science input may have a flawed scope, while a data science-driven project lacking engineering support struggles with deployment, delaying project completion.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f4c8; Sustaining model performance:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;ML models must continuously adapt to changing data, trends, and business needs to maintain effectiveness. Failure to keep model performance at required levels can lead to degraded model accuracy, resulting in poor decision-making, increasing costs and customer churn through degraded service delivery.&lt;/p&gt; 
&lt;p&gt;Example: An outdated recommendation system in e-commerce can result in decreased sales and lost market share as it fails to reflect current consumer preferences.&lt;/p&gt; 
&lt;h2&gt;Challenge 3: Technology and Data&lt;/h2&gt; 
&lt;p&gt;AI systems are complex, combining the intricacies of standard software systems with the added challenges of large-scale data and models. This makes operationalizing AI systems a particularly tough challenge. While numerous technology and data hurdles exist, here we highlight the top three that are frequently underestimated.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f527; Data Quality and Management:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Effective data governance is essential for AI/ML projects. Challenges arise when data are poorly formatted, scattered across various sources, or of low quality. These issues can significantly compromise the accuracy of machine learning models.&lt;/p&gt; 
&lt;p&gt;Example: In a healthcare analytics project predicting patient outcomes with machine learning, the team faced data quality challenges. The dataset, sourced from multiple places, had diverse formats, incomplete entries, and inconsistent quality. These issues hindered accurate predictive modelling, risking misleading conclusions due to data noise. &#x1f3e5;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f40c; Technology Stack Inefficiencies:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Each AI/ML project often begins from scratch, leading to a lack of standardisation, duplication of efforts, and a drift in technology stacks. This makes it difficult to maintain diverging models and pipelines and presents challenges in onboarding new team members efficiently.&lt;/p&gt; 
&lt;p&gt;Example: Managing different versions of machine learning frameworks like PyTorch and TensorFlow, sometimes across on-premises and various cloud environments, can become a logistical nightmare. This fragmentation can significantly delay project timelines and increase the complexity of deployments. ⚙️&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;&#x1f9e9; Maintaining Model and Pipeline Integrity:&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Keeping machine learning models and their associated data pipelines consistent and up-to-date is a challenge due to the rapidly evolving nature of technology and business requirements. This can lead to discrepancies in model performance and difficulties in ensuring that the entire AI system remains coherent and aligned with current objectives.&lt;/p&gt; 
&lt;p&gt;Example: An organisation might struggle to update its sales forecasting models in line with new market conditions if its data pipelines are not designed to adapt to changes efficiently. This can result in outdated predictions and missed opportunities. &#x1f4ca;&lt;/p&gt; 
&lt;h2&gt;What then?&lt;/h2&gt; 
&lt;p&gt;Each business is unique. However, we’ve gathered some insights from working with 10+ data science teams.&lt;/p&gt; 
&lt;p&gt;1️⃣ &lt;strong&gt;Share knowledge and REUSE:&lt;/strong&gt; Sharing and reusing ML assets, as exemplified by a startup’s 30% reduction in development time, directly addresses business challenges by optimising resources and accelerating time-to-market.&lt;/p&gt; 
&lt;p&gt;On the tech side, it enhances development efficiency and ensures consistency, while in processes, it streamlines workflows and facilitates knowledge transfer. This practice offers tangible solutions to various challenges encountered in AI and ML projects.&lt;/p&gt; 
&lt;p&gt;2️⃣ &lt;strong&gt;Form a great TEAM:&lt;/strong&gt; Creating a dynamic team with a diverse skill set, as seen in a recent project transitioning seamlessly from data preprocessing to model deployment, addresses business challenges by providing comprehensive expertise.&lt;/p&gt; 
&lt;p&gt;This approach also tackles tech challenges through adaptability and fosters a culture of continuous improvement to address process challenges efficiently. &#x1f333;&lt;/p&gt; 
&lt;p&gt;3️⃣ &lt;strong&gt;Involve Business:&lt;/strong&gt; Involving stakeholders throughout development aligns solutions with user expectations, addressing business challenges by staying user-centric and market-relevant. It tackles tech challenges through adaptability and ensures effective communication, mitigating process challenges through iterative improvements. &#x1f504;&lt;/p&gt; 
&lt;p&gt;4️⃣ &lt;strong&gt;Iterative DEVELOPMENT:&lt;/strong&gt; Starting with heuristics and an MVP addresses business challenges by enabling quick market entry and iterative improvements for customer satisfaction. It tackles tech challenges through optimised model accuracy and resource-efficient development while addressing process challenges through a user-centric and agile approach. &#x1f680;&lt;/p&gt; 
&lt;p&gt;5️⃣ &lt;strong&gt;Focus on VALUE:&lt;/strong&gt; Prioritising features for a better end-user experience addresses business challenges by boosting monetisation and customer satisfaction. It tackles tech challenges through efficient resource allocation and continuous improvement while addressing process challenges by fostering user-centric development and effective decision-making. &#x1f4a1;&lt;/p&gt; 
&lt;h2&gt;Conclusion&lt;/h2&gt; 
&lt;p&gt;Finally, for every data science, machine learning, and AI use cases, always ask…&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;“Does it solve a practical problem? Does it create tangible value?”&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;Remember, successful AI/ML solutions create substantial worth.&lt;/p&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Thanks for reading. If you want to know more about cloud-native tech and machine learning deployments, email us at &lt;a href="mailto:poke@melio.ai"&gt;poke@melio.ai&lt;/a&gt;.&lt;/p&gt;   
&lt;img src="https://track-eu1.hubspot.com/__ptq.gif?a=139509833&amp;amp;k=14&amp;amp;r=https%3A%2F%2Fpages.melio.ai%2Finsights%2Fai-time-to-value&amp;amp;bu=https%253A%252F%252Fpages.melio.ai%252Finsights&amp;amp;bvt=rss" alt="" width="1" height="1" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important; "&gt;</content:encoded>
      <category>business</category>
      <category>mlops</category>
      <category>ai</category>
      <category>time-to-value</category>
      <category>Articles</category>
      <pubDate>Tue, 15 Sep 2026 17:27:20 GMT</pubDate>
      <guid>https://pages.melio.ai/insights/ai-time-to-value</guid>
      <dc:date>2026-09-15T17:27:20Z</dc:date>
      <dc:creator>Admin</dc:creator>
    </item>
    <item>
      <title>What the Ops are you talking about?</title>
      <link>https://pages.melio.ai/insights/what-the-ops</link>
      <description>&lt;div class="hs-featured-image-wrapper"&gt; 
 &lt;a href="https://pages.melio.ai/insights/what-the-ops" title="" class="hs-featured-image-link"&gt; &lt;img src="https://pages.melio.ai/hubfs/Imported_Blog_Media/cover-Apr-03-2024-12-39-03-3903-PM.webp" alt="What the Ops are you talking about?" class="hs-featured-image" style="width:auto !important; max-width:50%; float:left; margin:0 15px 15px 0;"&gt; &lt;/a&gt; 
&lt;/div&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;How to choose between DataOps vs MLOps vs AIOps - what are the right Ops for your big data team?&lt;/p&gt; 
&lt;/blockquote&gt;   
&lt;h6&gt;Photo by Freepik from Freepik.&lt;/h6&gt;   
&lt;p&gt;The software industry has been obsessed with the various ops-terms since the popularisation of &lt;a href="https://www.atlassian.com/devops/what-is-devops/history-of-devops"&gt;DevOps in the late 2000s&lt;/a&gt; . Ten years ago, software development to deployment has a throw-over-the-world approach. A software engineer develops the app, then throw it over to the operational engineers. The app breaks often during deployment and creates significant friction between the teams.&lt;/p&gt; 
&lt;p&gt;The DevOps practice came about to smooth out the deployment process. The idea is to treat &lt;strong&gt;automation&lt;/strong&gt; as a first-class citizen to build &amp;amp; deploy software applications.&lt;/p&gt; 
&lt;p&gt;This approach revolutionised the industry. Many organisations started building a cross-functional team to look after the entire SDLC. The team would set up the infrastructure (infra engineer), develop the app (software engineer), build the CI/CD pipeline (DevOps engineer), deploy the app (every engineer), then monitor and observe the app continuously (site-reliability engineer).&lt;/p&gt; 
&lt;p&gt;In a big team, different engineers have one primary function. But in smaller teams, one engineer often fills many roles. The ideal is to have many team members able to fill multiple functions so the bottlenecks and key-man dependencies are removed. So in reality…&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;DevOps, instead of it being a job function, is more practice or culture.   It should be adopted at the beginning of building any software&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Together with the rise of DevOps, a variety of ops are born.&lt;/p&gt;   
&lt;h6&gt;The various Ops that exist in the software development world. Generated by Autor.&lt;/h6&gt;   
&lt;p&gt;SecOps has security at the core, GitOps strive for continuous delivery, NetOps ensures the network can support the flow of data and ITOps focuses on the operational tasks outside of software delivery. But together, the cornerstone of these ops is derived from the vision that DevOps promises:&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;To get software out there as fast as possible, with minimal errors.&lt;/p&gt; 
&lt;/div&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Five years ago, the phrase Data is the new Oil became all the hype. Leaders around the world started pouring resources into building Big Data teams to mine these valuable assets. The pressure for these teams to deliver was immense — after all, how can we fail with the promise of the new oil? With the rapid expansion, the analytics teams had also experienced their fair share of grief.&lt;/p&gt; 
&lt;p&gt;Then we made it all happen.&lt;/p&gt; 
&lt;p&gt;Data scientists became the sexiest career in the 21st century. We build ourselves up and are sitting in the golden age of data and analytics. Every exec has a dashboard. A dashboard with data from across the organisation and the predictive model embedded. Every customer has a personalised recommendation based on their behaviours.&lt;/p&gt; 
&lt;p&gt;But now adding a new feature takes weeks if not months. The data schema is a mess and nobody knows if we are using the definition of an active customer from credit team or marketing team. We became wary of rolling models out into production because we’re not sure what it will break.&lt;/p&gt; 
&lt;p&gt;So the data-centred communities stood together to pledge against inefficiencies seeded from badly managed data processes. Since then, a variety of data-centred ops are also born…&lt;/p&gt;   
&lt;h6&gt;The various Ops that are born in the data-centred teams: DataOps vs. MLOps vs. AIOps. Generated by Autor.&lt;/h6&gt;   
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;h2&gt;DataOps &#x1f19a; MLOps &#x1f19a; DevOps (and AIOps?)&lt;/h2&gt; 
&lt;p&gt;&lt;em&gt;*Note: In this article, analytics teams refer to traditional BI teams using SQL/PowerBI to generate insights for business. AI teams refer to teams using Big Data technology to build advanced analytics and machine learning models. Sometimes they’re the same team, but we’re going to keep them separate so it’s easier to explain the concepts.&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;To understand all these different ops, let’s set the scene on how the data flows through the organisation:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Data is generated by customers interacting with software applications.&lt;/li&gt; 
 &lt;li&gt;The software stores the data in its application database.&lt;/li&gt; 
 &lt;li&gt;The analytics team builds ETLs off these application databases from teams across the organisations.&lt;/li&gt; 
 &lt;li&gt;Analytics teams build reports and dashboards for business users to make data-driven decisions.&lt;/li&gt; 
 &lt;li&gt;The data engineers then ingest the raw data, consolidated datasets (from analytics teams) and other unstructured datasets into some form of a data lake.&lt;/li&gt; 
 &lt;li&gt;The data scientists then build models from these massive datasets.&lt;/li&gt; 
 &lt;li&gt;These models then take new data generated by the users to make predictions.&lt;/li&gt; 
 &lt;li&gt;The software engineers then surface the predictions to the users, and the cycle continues…&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;We know that DevOps is born because of the friction created between the development and operations team. So, imagine the headache that ensued from a 4-way interface, between the ops, software, analytics, and AI teams.&lt;/p&gt; 
&lt;p&gt;To explain how the different ops come in solving the processes above, here’s a graph plotting some of the the tasks that each job function performs across the timeline.&lt;/p&gt;   
&lt;h6&gt;A graph of the tasks that each job function performs across the timeline. Generated by Author.&lt;/h6&gt;   
&lt;p&gt;Ideally, the X-Ops culture should be adopted at the inception of the project and the practices implemented throughout. To summarise, this is what each Ops means:&lt;/p&gt; 
&lt;h3&gt;DevOps delivers software faster&lt;/h3&gt; 
&lt;p&gt;A set of practices aims to remove the barriers between the development and operations team to build &amp;amp; deploy software faster. It is usually adopted by the engineering teams, including DevOps engineers, infrastructure engineers, software engineers, site reliability engineers and data engineers.&lt;/p&gt; 
&lt;h3&gt;DataOps delivers data faster&lt;/h3&gt; 
&lt;p&gt;A set of practices to improve the quality and reduce the cycle time of data analytics. The main tasks in DataOps include data tagging, data testing, data pipeline orchestration, data versioning and data monitoring. Analytics and Big Data teams are the main operators of DataOps, but anyone who generates and consumes data should adopt good DataOps practices. This includes data analysts, BI analysts, data scientists, data engineers, and sometimes software engineers.&lt;/p&gt; 
&lt;h3&gt;MLOps delivers machine learning models faster&lt;/h3&gt; 
&lt;p&gt;A set of practices to design, build and manage reproducible, testable and sustainable ML-powered software. For Big Data/Machine Learning teams, MLOps incorporate most DataOps tasks and additional ML-specific tasks, such as model versioning, testing, validation and monitoring.&lt;/p&gt; 
&lt;h3&gt;Bonus: AIOps enhances DevOps tools using the power of AI&lt;/h3&gt; 
&lt;p&gt;Sometimes people incorrectly refer to MLOps as AIOps, but they’re quite different. From Gartner:&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;AIOps platforms utilize big data, modern machine learning and other advanced analytics technologies to directly and indirectly enhance IT operations (monitoring, automation and service desk) functions with proactive, personal and dynamic insight.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;So AIOps typically are DevOps tools that uses AI-powered technology to enhance the service offerings. Alerting &amp;amp; anomaly detection offered by &lt;a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/migration-operations-integration/aiops.html"&gt;AWS CloudWatch&lt;/a&gt; is a good example of AIOps.&lt;/p&gt; 
&lt;h2&gt;&#x1f48e; Principals not Job Roles&lt;/h2&gt; 
&lt;p&gt;It is a misconception that in order to achieve the efficiency that these ops promise, they need to start with choosing the right technology. In fact, technology is not the most important thing.&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;“DataOps, MLOps and DevOps practice must be language-, framework, platform and infrastructure agnostic.”&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Everyone has a different workflow, and that workflow should be informed by the principals — not the technology you want to try, or the technology that is the most popular. The trap of going technology first will be if you want to use a hammer, everything looks like a nail to you.&lt;/p&gt; 
&lt;p&gt;All the ops have the same 7 overarching principals, but each with its own slight nuances:&lt;/p&gt; 
&lt;h3&gt;1. Compliance&lt;/h3&gt; 
&lt;p&gt;DevOps typically worries about network &amp;amp; application security. In the MLOps realm, industries such as finance and healthcare often require model explainability. DataOps need to ensure the data product is compliant with the laws such as GDPR/HIPPA.&lt;/p&gt; 
&lt;p&gt;&#x1f527; Tools: &lt;a href="https://github.com/OpenMined/PySyft"&gt;PySyft&lt;/a&gt; decouples private data for model training, &lt;a href="https://aircloak.com/"&gt;AirCloak&lt;/a&gt; for data anonymisation. &lt;a href="https://github.com/EthicalML/awesome-artificial-intelligence-guidelines"&gt;Awesome AI Guidelines&lt;/a&gt; for a curation of principals, standards and regulations around AI.&lt;/p&gt; 
&lt;h3&gt;2. Iterative Development&lt;/h3&gt; 
&lt;p&gt;This principal stems from the agile methodology, which focuses on continuously generating business value in a sustainable way. The product is designed, built, tested and deployed iteratively to maximise the fail fast and learn principal.&lt;/p&gt; 
&lt;h3&gt;3. Reproducibility&lt;/h3&gt; 
&lt;p&gt;Software systems are typically deterministic: the code should run exactly the same way every time. So to ensure reproducibility DevOps only needs to keep track of the code.&lt;/p&gt; 
&lt;p&gt;However, machine learning models are often retrained because of either data drift. In order to reproduce the results, MLOps need to version the model and DataOps need to version the data. When being asked by an auditor which data was used to train which model to produce this specific result, the data scientist needs to be able to answer that.&lt;/p&gt; 
&lt;p&gt;&#x1f527; Tools: experiment tracking tools, such as &lt;a href="https://kubeflow.org/"&gt;KubeFlow&lt;/a&gt;, &lt;a href="https://mlflow.org/"&gt;MLFlow&lt;/a&gt; or SageMaker all have functionalities that link metadata to the experiment run. &lt;a href="https://www.pachyderm.com/"&gt;Pachyderm&lt;/a&gt; and &lt;a href="https://dvc.org/"&gt;DVC&lt;/a&gt; for data versioning.&lt;/p&gt; 
&lt;h3&gt;4. Testing&lt;/h3&gt; 
&lt;p&gt;Testing for software lies in unit, integration, and regression testing. DataOps require rigorous data testing, which can include schema changes, data drifts, data validation after feature engineering, etc. From ML perspective, model accuracy, security, bias/fairness, interpretability all need to be tested.&lt;/p&gt; 
&lt;p&gt;&#x1f527; Tools: libraries such as &lt;a href="https://github.com/slundberg/shap"&gt;Shap&lt;/a&gt; &amp;amp; &lt;a href="https://github.com/marcotcr/lime"&gt;Lime&lt;/a&gt; for interpretability, &lt;a href="https://www.fiddler.ai/"&gt;fiddler&lt;/a&gt; for explainability monitoring, &lt;a href="https://greatexpectations.io/"&gt;great expectation&lt;/a&gt; for data testing.&lt;/p&gt; 
&lt;h3&gt;5. Continuous Deployment&lt;/h3&gt; 
&lt;p&gt;There are three components to the continuous deployment of machine learning models.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;The first component is the triggering event, i.e. is the trigger a manual trigger by a data scientist, a calendar schedule event and a threshold trigger?&lt;/li&gt; 
 &lt;li&gt;The second component is the actual retraining of the new model. What are the scripts, data and hyperparameters that resulted in the model? Their versions and how they are linked to one another.&lt;/li&gt; 
 &lt;li&gt;The last component is the actual deployment of the model, which must be orchestrated by the deployment pipeline with alerting in place.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&#x1f527; Tools: most workflow management tools have this, such as AWS SageMaker, AzureML, DataRobot, etc. Open-source tools such as &lt;a href="https://www.seldon.io/"&gt;Seldon&lt;/a&gt;, &lt;a href="https://github.com/kubeflow/kfserving"&gt;Kubeflow KFServing&lt;/a&gt;.&lt;/p&gt; 
&lt;h3&gt;6. Automation&lt;/h3&gt; 
&lt;p&gt;Automation is the core-value of DevOps, and really there are a bunch of tools specialised in different aspects of automation. Here are some resources for machine learning projects:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href="https://github.com/josephmisiti/awesome-machine-learning"&gt;Awesome Machine Learning&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href="https://github.com/ethicalml/awesome-production-machine-learning"&gt;Awesome Production Machine Learning&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;7. Monitoring&lt;/h3&gt; 
&lt;p&gt;Software applications need to be monitored, so does machine learning model and the data pipeline. For DataOps, it’s important to monitor the new data’s distribution for any data and/or concept drift. On the MLOps side, in addition to model degradation, it is also paramount to monitor adversarial attacks if your model has a public API.&lt;/p&gt; 
&lt;p&gt;&#x1f527; Tools: Most workflow management framework has some form of monitoring. Other popular tools include &lt;a href="https://prometheus.io/"&gt;Prometheus&lt;/a&gt; for monitoring metrics, &lt;a href="https://dessa-orbit-team-docs.readthedocs-hosted.com/en/latest/"&gt;Orbit by Dessa&lt;/a&gt; for data &amp;amp; model monitoring.&lt;/p&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;h2&gt;Conclusion&lt;/h2&gt; 
&lt;p&gt;Adopt the correct X-Ops culture to speed up the delivery of your data-, and machine learning-powered software product. Remember, principals over technology:&lt;/p&gt; 
&lt;p&gt;1️⃣ &lt;strong&gt;Build cross-disciplinary skills&lt;/strong&gt;: Nurture T-shaped individuals and teams to bridge the gap and align accountability&lt;/p&gt; 
&lt;p&gt;2️⃣ &lt;strong&gt;Automate early (enough)&lt;/strong&gt;: Converge on a technology stack and automate processes to alleviate engineering overhead&lt;/p&gt; 
&lt;p&gt;3️⃣ &lt;strong&gt;Develop with the end in mind&lt;/strong&gt;: Invest in solution design upfront to reduce friction from PoC to production&lt;/p&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Thanks for reading. If you want to know more about cloud-native tech and machine learning deployment, &lt;a href="http://merelda@melio.ai/"&gt;email us&lt;/a&gt; at melio.ai.&lt;/p&gt;</description>
      <content:encoded>&lt;div class="hs-featured-image-wrapper"&gt; 
 &lt;a href="https://pages.melio.ai/insights/what-the-ops" title="" class="hs-featured-image-link"&gt; &lt;img src="https://pages.melio.ai/hubfs/Imported_Blog_Media/cover-Apr-03-2024-12-39-03-3903-PM.webp" alt="What the Ops are you talking about?" class="hs-featured-image" style="width:auto !important; max-width:50%; float:left; margin:0 15px 15px 0;"&gt; &lt;/a&gt; 
&lt;/div&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;How to choose between DataOps vs MLOps vs AIOps - what are the right Ops for your big data team?&lt;/p&gt; 
&lt;/blockquote&gt;   
&lt;h6&gt;Photo by Freepik from Freepik.&lt;/h6&gt;   
&lt;p&gt;The software industry has been obsessed with the various ops-terms since the popularisation of &lt;a href="https://www.atlassian.com/devops/what-is-devops/history-of-devops"&gt;DevOps in the late 2000s&lt;/a&gt; . Ten years ago, software development to deployment has a throw-over-the-world approach. A software engineer develops the app, then throw it over to the operational engineers. The app breaks often during deployment and creates significant friction between the teams.&lt;/p&gt; 
&lt;p&gt;The DevOps practice came about to smooth out the deployment process. The idea is to treat &lt;strong&gt;automation&lt;/strong&gt; as a first-class citizen to build &amp;amp; deploy software applications.&lt;/p&gt; 
&lt;p&gt;This approach revolutionised the industry. Many organisations started building a cross-functional team to look after the entire SDLC. The team would set up the infrastructure (infra engineer), develop the app (software engineer), build the CI/CD pipeline (DevOps engineer), deploy the app (every engineer), then monitor and observe the app continuously (site-reliability engineer).&lt;/p&gt; 
&lt;p&gt;In a big team, different engineers have one primary function. But in smaller teams, one engineer often fills many roles. The ideal is to have many team members able to fill multiple functions so the bottlenecks and key-man dependencies are removed. So in reality…&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;DevOps, instead of it being a job function, is more practice or culture.   It should be adopted at the beginning of building any software&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Together with the rise of DevOps, a variety of ops are born.&lt;/p&gt;   
&lt;h6&gt;The various Ops that exist in the software development world. Generated by Autor.&lt;/h6&gt;   
&lt;p&gt;SecOps has security at the core, GitOps strive for continuous delivery, NetOps ensures the network can support the flow of data and ITOps focuses on the operational tasks outside of software delivery. But together, the cornerstone of these ops is derived from the vision that DevOps promises:&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;To get software out there as fast as possible, with minimal errors.&lt;/p&gt; 
&lt;/div&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Five years ago, the phrase Data is the new Oil became all the hype. Leaders around the world started pouring resources into building Big Data teams to mine these valuable assets. The pressure for these teams to deliver was immense — after all, how can we fail with the promise of the new oil? With the rapid expansion, the analytics teams had also experienced their fair share of grief.&lt;/p&gt; 
&lt;p&gt;Then we made it all happen.&lt;/p&gt; 
&lt;p&gt;Data scientists became the sexiest career in the 21st century. We build ourselves up and are sitting in the golden age of data and analytics. Every exec has a dashboard. A dashboard with data from across the organisation and the predictive model embedded. Every customer has a personalised recommendation based on their behaviours.&lt;/p&gt; 
&lt;p&gt;But now adding a new feature takes weeks if not months. The data schema is a mess and nobody knows if we are using the definition of an active customer from credit team or marketing team. We became wary of rolling models out into production because we’re not sure what it will break.&lt;/p&gt; 
&lt;p&gt;So the data-centred communities stood together to pledge against inefficiencies seeded from badly managed data processes. Since then, a variety of data-centred ops are also born…&lt;/p&gt;   
&lt;h6&gt;The various Ops that are born in the data-centred teams: DataOps vs. MLOps vs. AIOps. Generated by Autor.&lt;/h6&gt;   
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;h2&gt;DataOps &#x1f19a; MLOps &#x1f19a; DevOps (and AIOps?)&lt;/h2&gt; 
&lt;p&gt;&lt;em&gt;*Note: In this article, analytics teams refer to traditional BI teams using SQL/PowerBI to generate insights for business. AI teams refer to teams using Big Data technology to build advanced analytics and machine learning models. Sometimes they’re the same team, but we’re going to keep them separate so it’s easier to explain the concepts.&lt;/em&gt;&lt;/p&gt; 
&lt;p&gt;To understand all these different ops, let’s set the scene on how the data flows through the organisation:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Data is generated by customers interacting with software applications.&lt;/li&gt; 
 &lt;li&gt;The software stores the data in its application database.&lt;/li&gt; 
 &lt;li&gt;The analytics team builds ETLs off these application databases from teams across the organisations.&lt;/li&gt; 
 &lt;li&gt;Analytics teams build reports and dashboards for business users to make data-driven decisions.&lt;/li&gt; 
 &lt;li&gt;The data engineers then ingest the raw data, consolidated datasets (from analytics teams) and other unstructured datasets into some form of a data lake.&lt;/li&gt; 
 &lt;li&gt;The data scientists then build models from these massive datasets.&lt;/li&gt; 
 &lt;li&gt;These models then take new data generated by the users to make predictions.&lt;/li&gt; 
 &lt;li&gt;The software engineers then surface the predictions to the users, and the cycle continues…&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;We know that DevOps is born because of the friction created between the development and operations team. So, imagine the headache that ensued from a 4-way interface, between the ops, software, analytics, and AI teams.&lt;/p&gt; 
&lt;p&gt;To explain how the different ops come in solving the processes above, here’s a graph plotting some of the the tasks that each job function performs across the timeline.&lt;/p&gt;   
&lt;h6&gt;A graph of the tasks that each job function performs across the timeline. Generated by Author.&lt;/h6&gt;   
&lt;p&gt;Ideally, the X-Ops culture should be adopted at the inception of the project and the practices implemented throughout. To summarise, this is what each Ops means:&lt;/p&gt; 
&lt;h3&gt;DevOps delivers software faster&lt;/h3&gt; 
&lt;p&gt;A set of practices aims to remove the barriers between the development and operations team to build &amp;amp; deploy software faster. It is usually adopted by the engineering teams, including DevOps engineers, infrastructure engineers, software engineers, site reliability engineers and data engineers.&lt;/p&gt; 
&lt;h3&gt;DataOps delivers data faster&lt;/h3&gt; 
&lt;p&gt;A set of practices to improve the quality and reduce the cycle time of data analytics. The main tasks in DataOps include data tagging, data testing, data pipeline orchestration, data versioning and data monitoring. Analytics and Big Data teams are the main operators of DataOps, but anyone who generates and consumes data should adopt good DataOps practices. This includes data analysts, BI analysts, data scientists, data engineers, and sometimes software engineers.&lt;/p&gt; 
&lt;h3&gt;MLOps delivers machine learning models faster&lt;/h3&gt; 
&lt;p&gt;A set of practices to design, build and manage reproducible, testable and sustainable ML-powered software. For Big Data/Machine Learning teams, MLOps incorporate most DataOps tasks and additional ML-specific tasks, such as model versioning, testing, validation and monitoring.&lt;/p&gt; 
&lt;h3&gt;Bonus: AIOps enhances DevOps tools using the power of AI&lt;/h3&gt; 
&lt;p&gt;Sometimes people incorrectly refer to MLOps as AIOps, but they’re quite different. From Gartner:&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;AIOps platforms utilize big data, modern machine learning and other advanced analytics technologies to directly and indirectly enhance IT operations (monitoring, automation and service desk) functions with proactive, personal and dynamic insight.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;So AIOps typically are DevOps tools that uses AI-powered technology to enhance the service offerings. Alerting &amp;amp; anomaly detection offered by &lt;a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/migration-operations-integration/aiops.html"&gt;AWS CloudWatch&lt;/a&gt; is a good example of AIOps.&lt;/p&gt; 
&lt;h2&gt;&#x1f48e; Principals not Job Roles&lt;/h2&gt; 
&lt;p&gt;It is a misconception that in order to achieve the efficiency that these ops promise, they need to start with choosing the right technology. In fact, technology is not the most important thing.&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;“DataOps, MLOps and DevOps practice must be language-, framework, platform and infrastructure agnostic.”&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Everyone has a different workflow, and that workflow should be informed by the principals — not the technology you want to try, or the technology that is the most popular. The trap of going technology first will be if you want to use a hammer, everything looks like a nail to you.&lt;/p&gt; 
&lt;p&gt;All the ops have the same 7 overarching principals, but each with its own slight nuances:&lt;/p&gt; 
&lt;h3&gt;1. Compliance&lt;/h3&gt; 
&lt;p&gt;DevOps typically worries about network &amp;amp; application security. In the MLOps realm, industries such as finance and healthcare often require model explainability. DataOps need to ensure the data product is compliant with the laws such as GDPR/HIPPA.&lt;/p&gt; 
&lt;p&gt;&#x1f527; Tools: &lt;a href="https://github.com/OpenMined/PySyft"&gt;PySyft&lt;/a&gt; decouples private data for model training, &lt;a href="https://aircloak.com/"&gt;AirCloak&lt;/a&gt; for data anonymisation. &lt;a href="https://github.com/EthicalML/awesome-artificial-intelligence-guidelines"&gt;Awesome AI Guidelines&lt;/a&gt; for a curation of principals, standards and regulations around AI.&lt;/p&gt; 
&lt;h3&gt;2. Iterative Development&lt;/h3&gt; 
&lt;p&gt;This principal stems from the agile methodology, which focuses on continuously generating business value in a sustainable way. The product is designed, built, tested and deployed iteratively to maximise the fail fast and learn principal.&lt;/p&gt; 
&lt;h3&gt;3. Reproducibility&lt;/h3&gt; 
&lt;p&gt;Software systems are typically deterministic: the code should run exactly the same way every time. So to ensure reproducibility DevOps only needs to keep track of the code.&lt;/p&gt; 
&lt;p&gt;However, machine learning models are often retrained because of either data drift. In order to reproduce the results, MLOps need to version the model and DataOps need to version the data. When being asked by an auditor which data was used to train which model to produce this specific result, the data scientist needs to be able to answer that.&lt;/p&gt; 
&lt;p&gt;&#x1f527; Tools: experiment tracking tools, such as &lt;a href="https://kubeflow.org/"&gt;KubeFlow&lt;/a&gt;, &lt;a href="https://mlflow.org/"&gt;MLFlow&lt;/a&gt; or SageMaker all have functionalities that link metadata to the experiment run. &lt;a href="https://www.pachyderm.com/"&gt;Pachyderm&lt;/a&gt; and &lt;a href="https://dvc.org/"&gt;DVC&lt;/a&gt; for data versioning.&lt;/p&gt; 
&lt;h3&gt;4. Testing&lt;/h3&gt; 
&lt;p&gt;Testing for software lies in unit, integration, and regression testing. DataOps require rigorous data testing, which can include schema changes, data drifts, data validation after feature engineering, etc. From ML perspective, model accuracy, security, bias/fairness, interpretability all need to be tested.&lt;/p&gt; 
&lt;p&gt;&#x1f527; Tools: libraries such as &lt;a href="https://github.com/slundberg/shap"&gt;Shap&lt;/a&gt; &amp;amp; &lt;a href="https://github.com/marcotcr/lime"&gt;Lime&lt;/a&gt; for interpretability, &lt;a href="https://www.fiddler.ai/"&gt;fiddler&lt;/a&gt; for explainability monitoring, &lt;a href="https://greatexpectations.io/"&gt;great expectation&lt;/a&gt; for data testing.&lt;/p&gt; 
&lt;h3&gt;5. Continuous Deployment&lt;/h3&gt; 
&lt;p&gt;There are three components to the continuous deployment of machine learning models.&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;The first component is the triggering event, i.e. is the trigger a manual trigger by a data scientist, a calendar schedule event and a threshold trigger?&lt;/li&gt; 
 &lt;li&gt;The second component is the actual retraining of the new model. What are the scripts, data and hyperparameters that resulted in the model? Their versions and how they are linked to one another.&lt;/li&gt; 
 &lt;li&gt;The last component is the actual deployment of the model, which must be orchestrated by the deployment pipeline with alerting in place.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;&#x1f527; Tools: most workflow management tools have this, such as AWS SageMaker, AzureML, DataRobot, etc. Open-source tools such as &lt;a href="https://www.seldon.io/"&gt;Seldon&lt;/a&gt;, &lt;a href="https://github.com/kubeflow/kfserving"&gt;Kubeflow KFServing&lt;/a&gt;.&lt;/p&gt; 
&lt;h3&gt;6. Automation&lt;/h3&gt; 
&lt;p&gt;Automation is the core-value of DevOps, and really there are a bunch of tools specialised in different aspects of automation. Here are some resources for machine learning projects:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;&lt;a href="https://github.com/josephmisiti/awesome-machine-learning"&gt;Awesome Machine Learning&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href="https://github.com/ethicalml/awesome-production-machine-learning"&gt;Awesome Production Machine Learning&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;h3&gt;7. Monitoring&lt;/h3&gt; 
&lt;p&gt;Software applications need to be monitored, so does machine learning model and the data pipeline. For DataOps, it’s important to monitor the new data’s distribution for any data and/or concept drift. On the MLOps side, in addition to model degradation, it is also paramount to monitor adversarial attacks if your model has a public API.&lt;/p&gt; 
&lt;p&gt;&#x1f527; Tools: Most workflow management framework has some form of monitoring. Other popular tools include &lt;a href="https://prometheus.io/"&gt;Prometheus&lt;/a&gt; for monitoring metrics, &lt;a href="https://dessa-orbit-team-docs.readthedocs-hosted.com/en/latest/"&gt;Orbit by Dessa&lt;/a&gt; for data &amp;amp; model monitoring.&lt;/p&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;h2&gt;Conclusion&lt;/h2&gt; 
&lt;p&gt;Adopt the correct X-Ops culture to speed up the delivery of your data-, and machine learning-powered software product. Remember, principals over technology:&lt;/p&gt; 
&lt;p&gt;1️⃣ &lt;strong&gt;Build cross-disciplinary skills&lt;/strong&gt;: Nurture T-shaped individuals and teams to bridge the gap and align accountability&lt;/p&gt; 
&lt;p&gt;2️⃣ &lt;strong&gt;Automate early (enough)&lt;/strong&gt;: Converge on a technology stack and automate processes to alleviate engineering overhead&lt;/p&gt; 
&lt;p&gt;3️⃣ &lt;strong&gt;Develop with the end in mind&lt;/strong&gt;: Invest in solution design upfront to reduce friction from PoC to production&lt;/p&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Thanks for reading. If you want to know more about cloud-native tech and machine learning deployment, &lt;a href="http://merelda@melio.ai/"&gt;email us&lt;/a&gt; at melio.ai.&lt;/p&gt;   
&lt;img src="https://track-eu1.hubspot.com/__ptq.gif?a=139509833&amp;amp;k=14&amp;amp;r=https%3A%2F%2Fpages.melio.ai%2Finsights%2Fwhat-the-ops&amp;amp;bu=https%253A%252F%252Fpages.melio.ai%252Finsights&amp;amp;bvt=rss" alt="" width="1" height="1" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important; "&gt;</content:encoded>
      <category>mlops</category>
      <category>datascience</category>
      <category>medium</category>
      <pubDate>Tue, 15 Sep 2026 17:27:02 GMT</pubDate>
      <guid>https://pages.melio.ai/insights/what-the-ops</guid>
      <dc:date>2026-09-15T17:27:02Z</dc:date>
      <dc:creator>Admin</dc:creator>
    </item>
    <item>
      <title>Implementing Custom Authentication in Django</title>
      <link>https://pages.melio.ai/insights/django-custom-authentication-backends</link>
      <description>&lt;div class="hs-featured-image-wrapper"&gt; 
 &lt;a href="https://pages.melio.ai/insights/django-custom-authentication-backends" title="" class="hs-featured-image-link"&gt; &lt;img src="https://pages.melio.ai/hubfs/Imported_Blog_Media/cover-Apr-03-2024-12-39-02-1885-PM.webp" alt="Implementing Custom Authentication in Django" class="hs-featured-image" style="width:auto !important; max-width:50%; float:left; margin:0 15px 15px 0;"&gt; &lt;/a&gt; 
&lt;/div&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;When all other options fail, make your own.&lt;/p&gt; 
&lt;/blockquote&gt;   
&lt;h6&gt;Photo by pch.vector from Freepik.&lt;/h6&gt;   
&lt;h2&gt;Introduction&lt;/h2&gt; 
&lt;p&gt;This tutorial will take you from absolute zero to a fully-working custom authentication system in Django.&lt;/p&gt; 
&lt;p&gt;Django comes with built-in authentication backends that make it really easy to get started and meet most projects’ needs. There are also a slew of Django apps (such as &lt;a href="https://django-allauth.readthedocs.io/"&gt;django-allauth&lt;/a&gt;) that have been written to integrate with identity providers such as Google and GitHub.&lt;/p&gt; 
&lt;p&gt;But what do you do when even these don’t meet your needs?&lt;/p&gt; 
&lt;p&gt;For example, I was recently attempting to integrate a Django application with a Keycloak backend, and found that existing libraries such as:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;a href="https://django-keycloak.readthedocs.io/en/latest/"&gt;django-keycloak&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href="https://github.com/marcelo225/django-keycloak-auth"&gt;django-keycloak-auth&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href="https://django-allauth.readthedocs.io/"&gt;django-allauth&lt;/a&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;either did not work as advertised (though PEBKAC errors are not unlikely here) or did not work in exactly the way I needed. My only option was creating my own custom authentication backend. This sounds like a complicated thing to do, but is actually really simple.&lt;/p&gt; 
&lt;p&gt;I’ve included a TL;DR right up front if you already know a bit about Django. The code is also &lt;a href="https://github.com/bradleymarques/custom-authentication-backend-django"&gt;on GitHub&lt;/a&gt;.&lt;/p&gt; 
&lt;h2&gt;TL;DR - Just Gimme the Answer&lt;/h2&gt; 
&lt;p&gt;In a rush? Here’s the answer:&lt;/p&gt; 
&lt;h3&gt;settings.py&lt;/h3&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./mysite/settings.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INSTALLED_APPS &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ... other apps&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"django.contrib.auth"&lt;/span&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ... other apps&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"my_custom_authentication"&lt;/span&gt;, &lt;span style="color:#75715e"&gt;# Or whatever your app is called&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;AUTHENTICATION_BACKENDS &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"my_custom_authentication.backends.MyCustomAuthenticationBackend"&lt;/span&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;h3&gt;my_custom_authentication_backend.py&lt;/h3&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./my_custom_authentication/backends/my_custom_authentication_backend.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth.backends &lt;span style="color:#f92672"&gt;import&lt;/span&gt; BaseBackend &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth &lt;span style="color:#f92672"&gt;import&lt;/span&gt; get_user_model &lt;span style="color:#75715e"&gt;# Important for custom User objects&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;MyCustomAuthenticationBackend&lt;/span&gt;(BaseBackend): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;authenticate&lt;/span&gt;(self, request, username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;, password&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; user &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#75715e"&gt;# ... some custom logic such as an API call to an identity provider&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Return None if authentication fails, or a User object if authentication succeeds&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; user &lt;span style="color:#f92672"&gt;or&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;None&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;If the above doesn’t make much sense, follow the complete tutorial below:&lt;/p&gt; 
&lt;h2&gt;Starting the application&lt;/h2&gt; 
&lt;h3&gt;Poetry&lt;/h3&gt; 
&lt;p&gt;Let’s start by creating a &lt;a href="https://python-poetry.org/"&gt;Poetry&lt;/a&gt; (you could simply use &lt;code&gt;pip&lt;/code&gt; if you prefer) configuration file for the project. If not installed, please &lt;a href="https://python-poetry.org/docs/#installation"&gt;install Poetry&lt;/a&gt;.&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;poetry init &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Fill in your details, and choose to not define your dependencies interactively. Once complete, open the &lt;code&gt;pyproject.toml&lt;/code&gt; file and ensure that it has content similar to:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-toml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[&lt;span style="color:#a6e22e"&gt;tool&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;poetry&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;name&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;"your-application-name-here"&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;version&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;"0.1.0"&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;description&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;""&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;authors&lt;/span&gt; = [&lt;span style="color:#e6db74"&gt;"Your Name &amp;lt;your-email@example.com&amp;gt;"&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[&lt;span style="color:#a6e22e"&gt;tool&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;poetry&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;dependencies&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;python&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;"^3.10"&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;Django&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;"^4.0.5"&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[&lt;span style="color:#a6e22e"&gt;tool&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;poetry&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;dev-dependencies&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[&lt;span style="color:#a6e22e"&gt;build-system&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;requires&lt;/span&gt; = [&lt;span style="color:#e6db74"&gt;"poetry-core&amp;gt;=1.0.0"&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;build-backend&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;"poetry.core.masonry.api"&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Then open up a Poetry virtual environment and install the dependencies in it:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;poetry shell &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;poetry install &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;poetry update &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Check the installation of Django:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python -m django --version &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 4.0.5&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;h3&gt;Starting the Django Project and App&lt;/h3&gt; 
&lt;p&gt;If you don’t already know, Django has the concept of “projects” and pluggable “apps” that you install into the project. Let’s start the project by running:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;django-admin startproject mysite . &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Note the trailing dot in the above command.&lt;/p&gt; 
&lt;p&gt;Now we can go ahead and create the django app. We’ll make this application reusable, so go ahead and give it a name that suits your needs. For example, if your ultimate goal is to authenticate with &lt;code&gt;Dex&lt;/code&gt; or &lt;code&gt;Keycloak&lt;/code&gt; call it something like &lt;code&gt;dex_authentication&lt;/code&gt; or &lt;code&gt;keycloak_authentication&lt;/code&gt;. As a way of example, I am just going to do an in-memory authentication, so I will run:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python manage.py startapp in_memory_authentication &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;At this stage, we should already be able to start the Django application. Run:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python manage.py runserver &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Navigate to the URL shown (usually &lt;a href="http://localhost:8000"&gt;http://localhost:8000&lt;/a&gt;) and you should see a lovely rocket blasting off:&lt;/p&gt;   
&lt;h6&gt;The running Django application&lt;/h6&gt;   
&lt;h2&gt;Understanding Django’s Default User Authentication&lt;/h2&gt; 
&lt;p&gt;If don’t know already and you’re interested how Django would do normal User authentication, check out &lt;a href="https://learndjango.com/tutorials/django-login-and-logout-tutorial"&gt;this great tutorial&lt;/a&gt;. Because it’s already covered so well there, I won’t cover it here, and rather just proceed to customizing our user authentication.&lt;/p&gt; 
&lt;h2&gt;Implementing a Login Page&lt;/h2&gt; 
&lt;p&gt;The first thing we’d need to do is include a login page for our Users to authenticate. Go ahead and open the &lt;code&gt;./mysite/urls.py&lt;/code&gt; file. Add the following marked lines to it:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.urls &lt;span style="color:#f92672"&gt;import&lt;/span&gt; path, include &lt;span style="color:#75715e"&gt;# Added "include" here&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;urlpatterns &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; path(&lt;span style="color:#e6db74"&gt;'admin/'&lt;/span&gt;, admin&lt;span style="color:#f92672"&gt;.&lt;/span&gt;site&lt;span style="color:#f92672"&gt;.&lt;/span&gt;urls), &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; path(&lt;span style="color:#e6db74"&gt;"accounts/"&lt;/span&gt;, include(&lt;span style="color:#e6db74"&gt;"django.contrib.auth.urls"&lt;/span&gt;)), &lt;span style="color:#75715e"&gt;# Added this line&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;What this does is mount the default Views provided in the &lt;code&gt;django.contrib.auth&lt;/code&gt; app to a URL of our choice (in this case &lt;code&gt;accounts/&lt;/code&gt;).&lt;/p&gt; 
&lt;p&gt;Let’s run the server again (&lt;code&gt;python manage.py runserver&lt;/code&gt;) and this time navigate to &lt;a href="http://localhost:8000/accounts/login"&gt;http://localhost:8000/accounts/login&lt;/a&gt;. Oops! You should get an error page saying:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-txt"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TemplateDoesNotExist at /accounts/login/ &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;That’s because we need to define an HTML Template for the login page. Do this by creating the following folders in the root folder (i.e. NOT the &lt;code&gt;mysite&lt;/code&gt; nor &lt;code&gt;in_memory_authentication&lt;/code&gt; folders).&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir templates &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir templates/registration &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Then create a &lt;code&gt;login.html&lt;/code&gt; file in the &lt;code&gt;templates/registration&lt;/code&gt; folder with the following content:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-html"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;&lt;span style="color:#f92672"&gt;h2&lt;/span&gt;&amp;gt;Log In&amp;lt;/&lt;span style="color:#f92672"&gt;h2&lt;/span&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;&lt;span style="color:#f92672"&gt;form&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;method&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;"post"&lt;/span&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;&lt;span style="color:#f92672"&gt;button&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;type&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;"submit"&lt;/span&gt;&amp;gt;Log In&amp;lt;/&lt;span style="color:#f92672"&gt;button&lt;/span&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;/&lt;span style="color:#f92672"&gt;form&lt;/span&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;One final thing we need to do is configure our Django project to look for templates in this folder structure. Open up the &lt;code&gt;settings.py&lt;/code&gt; again, and look for the &lt;code&gt;TEMPLATES&lt;/code&gt; constant:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TEMPLATES &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;'DIRS'&lt;/span&gt;: [], &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Change the &lt;code&gt;DIRS&lt;/code&gt; value from an empty list to:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TEMPLATES &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;'DIRS'&lt;/span&gt;: [BASE_DIR &lt;span style="color:#f92672"&gt;/&lt;/span&gt; &lt;span style="color:#e6db74"&gt;"templates"&lt;/span&gt;], &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;This instructs our Django project to look for templates in folders called &lt;code&gt;templates&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Restart the server and navigate to &lt;a href="http://localhost:8000/accounts/login"&gt;http://localhost:8000/accounts/login&lt;/a&gt; again. You should see a beautiful login form:&lt;/p&gt;   
&lt;h6&gt;The login form. Hey, if you wanted a tutorial on CSS you came to the wrong place.&lt;/h6&gt;   
&lt;p&gt;Attempting to login with details will not work, obviously, for a number of reasons:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;We have not yet migrated our database, so have no User table&lt;/li&gt; 
 &lt;li&gt;Even if we had migrated our database, we have not created any User records.&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;Let’s correct the first problem now. First, stop the server and then run the following command to migrate the database:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python manage.py migrate &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;&lt;strong&gt;Huh?&lt;/strong&gt; You may be wondering at this stage where the definition of our User table comes from. It comes from the &lt;code&gt;django.contrib.auth&lt;/code&gt; app which is by default in the &lt;code&gt;INSTALLED_APPS&lt;/code&gt; in &lt;code&gt;settings.py&lt;/code&gt;.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Rerun the server, and try to login with any details. You should see a little message reading: &lt;code&gt;Please enter a correct username and password. ...&lt;/code&gt;&lt;/p&gt; 
&lt;h2&gt;Writing a Custom Authentication Backend&lt;/h2&gt; 
&lt;p&gt;Let’s now assume that we want to always allow access to the site with a hard-coded user with the credentials:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Username: &lt;code&gt;let_me_in&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;Password: &lt;code&gt;please&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Of course you would never want to do this, but it does illustrate how to create the custom Django authentication backend.&lt;/p&gt; 
&lt;p&gt;First, let’s create a new folder in our &lt;code&gt;./in_memory_authentication&lt;/code&gt; folder called &lt;code&gt;backends&lt;/code&gt;. Like any Python module, it will need a &lt;code&gt;__init__.py&lt;/code&gt; file, so create that, and go ahead and create a file for the actual backend. I called mine &lt;code&gt;./in_memory_authentication/backends/in_memory_authentication_backend.py&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Let’s populate this file now with the following:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./in_memory_authentication/backends/in_memory_authentication_backend.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth.backends &lt;span style="color:#f92672"&gt;import&lt;/span&gt; BaseBackend &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;InMemoryAuthenticationBackend&lt;/span&gt;(BaseBackend): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;authenticate&lt;/span&gt;(self, request, username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;, password&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;None&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;You will notice that I’m extending the &lt;code&gt;BaseBackend&lt;/code&gt; auth backend. It has a single function &lt;code&gt;authenticate&lt;/code&gt; that takes in the request, as well as &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt;. The function should respond in the following way:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Should return &lt;code&gt;None&lt;/code&gt; if the authentication attempt fails.&lt;/li&gt; 
 &lt;li&gt;Should return an instance of the User model if the authentication attempt succeeds.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Let’s export this in the newly-created &lt;code&gt;__init__.py&lt;/code&gt; file:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./in_memory_authentication/backends/__init__.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; .in_memory_authentication_backend &lt;span style="color:#f92672"&gt;import&lt;/span&gt; InMemoryAuthenticationBackend &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Let’s also “register” this backend with our Django app. Open up the &lt;code&gt;settings.py&lt;/code&gt; file and make the following two changes:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INSTALLED_APPS &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ... other apps&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"django.contrib.auth"&lt;/span&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ... other apps&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"in_memory_authentication"&lt;/span&gt;, &lt;span style="color:#75715e"&gt;# Install our new app here&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Add this to the bottom of the file:&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;AUTHENTICATION_BACKENDS &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"in_memory_authentication.backends.InMemoryAuthenticationBackend"&lt;/span&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Now if we attempt to login, our custom authentication backend will be called. Of course, we still won’t be able to login since we are always returning &lt;code&gt;None&lt;/code&gt; from our &lt;code&gt;authenticate&lt;/code&gt; method.&lt;/p&gt; 
&lt;p&gt;Let’s change that now.&lt;/p&gt; 
&lt;p&gt;Open up &lt;code&gt;./in_memory_authentication/backends/in_memory_authentication_backend.py&lt;/code&gt; and alter it to:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./in_memory_authentication/backends/in_memory_authentication_backend.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; uuid &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth.backends &lt;span style="color:#f92672"&gt;import&lt;/span&gt; BaseBackend &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth.models &lt;span style="color:#f92672"&gt;import&lt;/span&gt; User &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;InMemoryAuthenticationBackend&lt;/span&gt;(BaseBackend): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;authenticate&lt;/span&gt;(self, request, username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;, password&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Replace this silly logic with whatever you need:&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; username &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;"let_me_in"&lt;/span&gt; &lt;span style="color:#f92672"&gt;and&lt;/span&gt; password &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;"please"&lt;/span&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Create a new user&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user &lt;span style="color:#f92672"&gt;=&lt;/span&gt; User(username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;uuid&lt;span style="color:#f92672"&gt;.&lt;/span&gt;uuid4()&lt;span style="color:#f92672"&gt;.&lt;/span&gt;__str__()) &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user&lt;span style="color:#f92672"&gt;.&lt;/span&gt;set_unusable_password() &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user&lt;span style="color:#f92672"&gt;.&lt;/span&gt;save() &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; new_user &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;else&lt;/span&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;None&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;This is some silly logic, and you should replace it with what you need, but it creates a new User and returns that user, thus logging them in. You should replace this with things like a call to a Dex or Keycloak API, for example.&lt;/p&gt; 
&lt;p&gt;If you now login with the credentials &lt;code&gt;let_me_in&lt;/code&gt; and &lt;code&gt;please&lt;/code&gt;, you should successfully authenticate.&lt;/p&gt; 
&lt;p&gt;Of course, we have not built any pages after the user logs in, so you should get a &lt;code&gt;404 Page not found&lt;/code&gt; error at this stage.&lt;/p&gt; 
&lt;h2&gt;Catering for Custom User Classes&lt;/h2&gt; 
&lt;p&gt;You’ll notice above that I am returning an instance of the &lt;code&gt;django.contrib.auth.models.User&lt;/code&gt; class. However, not all Django projects will use this, and it is therefore better to make use of the &lt;code&gt;get_user_model()&lt;/code&gt; function to find what class this project uses. Further, we can extract the finding of the user into a method:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./in_memory_authentication/backends/in_memory_authentication_backend.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; uuid &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth.backends &lt;span style="color:#f92672"&gt;import&lt;/span&gt; BaseBackend &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth &lt;span style="color:#f92672"&gt;import&lt;/span&gt; get_user_model &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;InMemoryAuthenticationBackend&lt;/span&gt;(BaseBackend): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;authenticate&lt;/span&gt;(self, request, username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;, password&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; self&lt;span style="color:#f92672"&gt;.&lt;/span&gt;find_user(username, password) &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Replace this silly logic with something better, such as an API call to&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# an identity provider:&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;find_user&lt;/span&gt;(self, username, password): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; username &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;"let_me_in"&lt;/span&gt; &lt;span style="color:#f92672"&gt;and&lt;/span&gt; password &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;"please"&lt;/span&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; user_klass &lt;span style="color:#f92672"&gt;=&lt;/span&gt; get_user_model() &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user &lt;span style="color:#f92672"&gt;=&lt;/span&gt; user_klass(username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;uuid&lt;span style="color:#f92672"&gt;.&lt;/span&gt;uuid4()&lt;span style="color:#f92672"&gt;.&lt;/span&gt;__str__()) &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user&lt;span style="color:#f92672"&gt;.&lt;/span&gt;set_unusable_password() &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user&lt;span style="color:#f92672"&gt;.&lt;/span&gt;save() &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; new_user &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;else&lt;/span&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;None&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;That’s it! We’ve successfully created and used our own custom authentication backend in Django.&lt;/p&gt;</description>
      <content:encoded>&lt;div class="hs-featured-image-wrapper"&gt; 
 &lt;a href="https://pages.melio.ai/insights/django-custom-authentication-backends" title="" class="hs-featured-image-link"&gt; &lt;img src="https://pages.melio.ai/hubfs/Imported_Blog_Media/cover-Apr-03-2024-12-39-02-1885-PM.webp" alt="Implementing Custom Authentication in Django" class="hs-featured-image" style="width:auto !important; max-width:50%; float:left; margin:0 15px 15px 0;"&gt; &lt;/a&gt; 
&lt;/div&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;When all other options fail, make your own.&lt;/p&gt; 
&lt;/blockquote&gt;   
&lt;h6&gt;Photo by pch.vector from Freepik.&lt;/h6&gt;   
&lt;h2&gt;Introduction&lt;/h2&gt; 
&lt;p&gt;This tutorial will take you from absolute zero to a fully-working custom authentication system in Django.&lt;/p&gt; 
&lt;p&gt;Django comes with built-in authentication backends that make it really easy to get started and meet most projects’ needs. There are also a slew of Django apps (such as &lt;a href="https://django-allauth.readthedocs.io/"&gt;django-allauth&lt;/a&gt;) that have been written to integrate with identity providers such as Google and GitHub.&lt;/p&gt; 
&lt;p&gt;But what do you do when even these don’t meet your needs?&lt;/p&gt; 
&lt;p&gt;For example, I was recently attempting to integrate a Django application with a Keycloak backend, and found that existing libraries such as:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;&lt;a href="https://django-keycloak.readthedocs.io/en/latest/"&gt;django-keycloak&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href="https://github.com/marcelo225/django-keycloak-auth"&gt;django-keycloak-auth&lt;/a&gt;&lt;/li&gt; 
 &lt;li&gt;&lt;a href="https://django-allauth.readthedocs.io/"&gt;django-allauth&lt;/a&gt;&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;either did not work as advertised (though PEBKAC errors are not unlikely here) or did not work in exactly the way I needed. My only option was creating my own custom authentication backend. This sounds like a complicated thing to do, but is actually really simple.&lt;/p&gt; 
&lt;p&gt;I’ve included a TL;DR right up front if you already know a bit about Django. The code is also &lt;a href="https://github.com/bradleymarques/custom-authentication-backend-django"&gt;on GitHub&lt;/a&gt;.&lt;/p&gt; 
&lt;h2&gt;TL;DR - Just Gimme the Answer&lt;/h2&gt; 
&lt;p&gt;In a rush? Here’s the answer:&lt;/p&gt; 
&lt;h3&gt;settings.py&lt;/h3&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./mysite/settings.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INSTALLED_APPS &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ... other apps&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"django.contrib.auth"&lt;/span&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ... other apps&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"my_custom_authentication"&lt;/span&gt;, &lt;span style="color:#75715e"&gt;# Or whatever your app is called&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;AUTHENTICATION_BACKENDS &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"my_custom_authentication.backends.MyCustomAuthenticationBackend"&lt;/span&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;h3&gt;my_custom_authentication_backend.py&lt;/h3&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./my_custom_authentication/backends/my_custom_authentication_backend.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth.backends &lt;span style="color:#f92672"&gt;import&lt;/span&gt; BaseBackend &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth &lt;span style="color:#f92672"&gt;import&lt;/span&gt; get_user_model &lt;span style="color:#75715e"&gt;# Important for custom User objects&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;MyCustomAuthenticationBackend&lt;/span&gt;(BaseBackend): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;authenticate&lt;/span&gt;(self, request, username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;, password&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; user &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#75715e"&gt;# ... some custom logic such as an API call to an identity provider&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Return None if authentication fails, or a User object if authentication succeeds&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; user &lt;span style="color:#f92672"&gt;or&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;None&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;If the above doesn’t make much sense, follow the complete tutorial below:&lt;/p&gt; 
&lt;h2&gt;Starting the application&lt;/h2&gt; 
&lt;h3&gt;Poetry&lt;/h3&gt; 
&lt;p&gt;Let’s start by creating a &lt;a href="https://python-poetry.org/"&gt;Poetry&lt;/a&gt; (you could simply use &lt;code&gt;pip&lt;/code&gt; if you prefer) configuration file for the project. If not installed, please &lt;a href="https://python-poetry.org/docs/#installation"&gt;install Poetry&lt;/a&gt;.&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;poetry init &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Fill in your details, and choose to not define your dependencies interactively. Once complete, open the &lt;code&gt;pyproject.toml&lt;/code&gt; file and ensure that it has content similar to:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-toml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[&lt;span style="color:#a6e22e"&gt;tool&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;poetry&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;name&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;"your-application-name-here"&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;version&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;"0.1.0"&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;description&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;""&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;authors&lt;/span&gt; = [&lt;span style="color:#e6db74"&gt;"Your Name &amp;lt;your-email@example.com&amp;gt;"&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[&lt;span style="color:#a6e22e"&gt;tool&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;poetry&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;dependencies&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;python&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;"^3.10"&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;Django&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;"^4.0.5"&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[&lt;span style="color:#a6e22e"&gt;tool&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;poetry&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;dev-dependencies&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[&lt;span style="color:#a6e22e"&gt;build-system&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;requires&lt;/span&gt; = [&lt;span style="color:#e6db74"&gt;"poetry-core&amp;gt;=1.0.0"&lt;/span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;build-backend&lt;/span&gt; = &lt;span style="color:#e6db74"&gt;"poetry.core.masonry.api"&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Then open up a Poetry virtual environment and install the dependencies in it:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;poetry shell &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;poetry install &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;poetry update &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Check the installation of Django:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python -m django --version &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 4.0.5&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;h3&gt;Starting the Django Project and App&lt;/h3&gt; 
&lt;p&gt;If you don’t already know, Django has the concept of “projects” and pluggable “apps” that you install into the project. Let’s start the project by running:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;django-admin startproject mysite . &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Note the trailing dot in the above command.&lt;/p&gt; 
&lt;p&gt;Now we can go ahead and create the django app. We’ll make this application reusable, so go ahead and give it a name that suits your needs. For example, if your ultimate goal is to authenticate with &lt;code&gt;Dex&lt;/code&gt; or &lt;code&gt;Keycloak&lt;/code&gt; call it something like &lt;code&gt;dex_authentication&lt;/code&gt; or &lt;code&gt;keycloak_authentication&lt;/code&gt;. As a way of example, I am just going to do an in-memory authentication, so I will run:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python manage.py startapp in_memory_authentication &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;At this stage, we should already be able to start the Django application. Run:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python manage.py runserver &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Navigate to the URL shown (usually &lt;a href="http://localhost:8000"&gt;http://localhost:8000&lt;/a&gt;) and you should see a lovely rocket blasting off:&lt;/p&gt;   
&lt;h6&gt;The running Django application&lt;/h6&gt;   
&lt;h2&gt;Understanding Django’s Default User Authentication&lt;/h2&gt; 
&lt;p&gt;If don’t know already and you’re interested how Django would do normal User authentication, check out &lt;a href="https://learndjango.com/tutorials/django-login-and-logout-tutorial"&gt;this great tutorial&lt;/a&gt;. Because it’s already covered so well there, I won’t cover it here, and rather just proceed to customizing our user authentication.&lt;/p&gt; 
&lt;h2&gt;Implementing a Login Page&lt;/h2&gt; 
&lt;p&gt;The first thing we’d need to do is include a login page for our Users to authenticate. Go ahead and open the &lt;code&gt;./mysite/urls.py&lt;/code&gt; file. Add the following marked lines to it:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.urls &lt;span style="color:#f92672"&gt;import&lt;/span&gt; path, include &lt;span style="color:#75715e"&gt;# Added "include" here&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;urlpatterns &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; path(&lt;span style="color:#e6db74"&gt;'admin/'&lt;/span&gt;, admin&lt;span style="color:#f92672"&gt;.&lt;/span&gt;site&lt;span style="color:#f92672"&gt;.&lt;/span&gt;urls), &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; path(&lt;span style="color:#e6db74"&gt;"accounts/"&lt;/span&gt;, include(&lt;span style="color:#e6db74"&gt;"django.contrib.auth.urls"&lt;/span&gt;)), &lt;span style="color:#75715e"&gt;# Added this line&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;What this does is mount the default Views provided in the &lt;code&gt;django.contrib.auth&lt;/code&gt; app to a URL of our choice (in this case &lt;code&gt;accounts/&lt;/code&gt;).&lt;/p&gt; 
&lt;p&gt;Let’s run the server again (&lt;code&gt;python manage.py runserver&lt;/code&gt;) and this time navigate to &lt;a href="http://localhost:8000/accounts/login"&gt;http://localhost:8000/accounts/login&lt;/a&gt;. Oops! You should get an error page saying:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-txt"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TemplateDoesNotExist at /accounts/login/ &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;That’s because we need to define an HTML Template for the login page. Do this by creating the following folders in the root folder (i.e. NOT the &lt;code&gt;mysite&lt;/code&gt; nor &lt;code&gt;in_memory_authentication&lt;/code&gt; folders).&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir templates &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mkdir templates/registration &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Then create a &lt;code&gt;login.html&lt;/code&gt; file in the &lt;code&gt;templates/registration&lt;/code&gt; folder with the following content:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-html"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;&lt;span style="color:#f92672"&gt;h2&lt;/span&gt;&amp;gt;Log In&amp;lt;/&lt;span style="color:#f92672"&gt;h2&lt;/span&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;&lt;span style="color:#f92672"&gt;form&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;method&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;"post"&lt;/span&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;&lt;span style="color:#f92672"&gt;button&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;type&lt;/span&gt;&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;"submit"&lt;/span&gt;&amp;gt;Log In&amp;lt;/&lt;span style="color:#f92672"&gt;button&lt;/span&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;/&lt;span style="color:#f92672"&gt;form&lt;/span&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;One final thing we need to do is configure our Django project to look for templates in this folder structure. Open up the &lt;code&gt;settings.py&lt;/code&gt; again, and look for the &lt;code&gt;TEMPLATES&lt;/code&gt; constant:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TEMPLATES &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;'DIRS'&lt;/span&gt;: [], &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Change the &lt;code&gt;DIRS&lt;/code&gt; value from an empty list to:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TEMPLATES &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; { &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;'DIRS'&lt;/span&gt;: [BASE_DIR &lt;span style="color:#f92672"&gt;/&lt;/span&gt; &lt;span style="color:#e6db74"&gt;"templates"&lt;/span&gt;], &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;This instructs our Django project to look for templates in folders called &lt;code&gt;templates&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Restart the server and navigate to &lt;a href="http://localhost:8000/accounts/login"&gt;http://localhost:8000/accounts/login&lt;/a&gt; again. You should see a beautiful login form:&lt;/p&gt;   
&lt;h6&gt;The login form. Hey, if you wanted a tutorial on CSS you came to the wrong place.&lt;/h6&gt;   
&lt;p&gt;Attempting to login with details will not work, obviously, for a number of reasons:&lt;/p&gt; 
&lt;ol&gt; 
 &lt;li&gt;We have not yet migrated our database, so have no User table&lt;/li&gt; 
 &lt;li&gt;Even if we had migrated our database, we have not created any User records.&lt;/li&gt; 
&lt;/ol&gt; 
&lt;p&gt;Let’s correct the first problem now. First, stop the server and then run the following command to migrate the database:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python manage.py migrate &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;&lt;strong&gt;Huh?&lt;/strong&gt; You may be wondering at this stage where the definition of our User table comes from. It comes from the &lt;code&gt;django.contrib.auth&lt;/code&gt; app which is by default in the &lt;code&gt;INSTALLED_APPS&lt;/code&gt; in &lt;code&gt;settings.py&lt;/code&gt;.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Rerun the server, and try to login with any details. You should see a little message reading: &lt;code&gt;Please enter a correct username and password. ...&lt;/code&gt;&lt;/p&gt; 
&lt;h2&gt;Writing a Custom Authentication Backend&lt;/h2&gt; 
&lt;p&gt;Let’s now assume that we want to always allow access to the site with a hard-coded user with the credentials:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Username: &lt;code&gt;let_me_in&lt;/code&gt;&lt;/li&gt; 
 &lt;li&gt;Password: &lt;code&gt;please&lt;/code&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Of course you would never want to do this, but it does illustrate how to create the custom Django authentication backend.&lt;/p&gt; 
&lt;p&gt;First, let’s create a new folder in our &lt;code&gt;./in_memory_authentication&lt;/code&gt; folder called &lt;code&gt;backends&lt;/code&gt;. Like any Python module, it will need a &lt;code&gt;__init__.py&lt;/code&gt; file, so create that, and go ahead and create a file for the actual backend. I called mine &lt;code&gt;./in_memory_authentication/backends/in_memory_authentication_backend.py&lt;/code&gt;.&lt;/p&gt; 
&lt;p&gt;Let’s populate this file now with the following:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./in_memory_authentication/backends/in_memory_authentication_backend.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth.backends &lt;span style="color:#f92672"&gt;import&lt;/span&gt; BaseBackend &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;InMemoryAuthenticationBackend&lt;/span&gt;(BaseBackend): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;authenticate&lt;/span&gt;(self, request, username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;, password&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;None&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;You will notice that I’m extending the &lt;code&gt;BaseBackend&lt;/code&gt; auth backend. It has a single function &lt;code&gt;authenticate&lt;/code&gt; that takes in the request, as well as &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt;. The function should respond in the following way:&lt;/p&gt; 
&lt;ul&gt; 
 &lt;li&gt;Should return &lt;code&gt;None&lt;/code&gt; if the authentication attempt fails.&lt;/li&gt; 
 &lt;li&gt;Should return an instance of the User model if the authentication attempt succeeds.&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;Let’s export this in the newly-created &lt;code&gt;__init__.py&lt;/code&gt; file:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./in_memory_authentication/backends/__init__.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; .in_memory_authentication_backend &lt;span style="color:#f92672"&gt;import&lt;/span&gt; InMemoryAuthenticationBackend &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Let’s also “register” this backend with our Django app. Open up the &lt;code&gt;settings.py&lt;/code&gt; file and make the following two changes:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INSTALLED_APPS &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ... other apps&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"django.contrib.auth"&lt;/span&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# ... other apps&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"in_memory_authentication"&lt;/span&gt;, &lt;span style="color:#75715e"&gt;# Install our new app here&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ...&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Add this to the bottom of the file:&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;AUTHENTICATION_BACKENDS &lt;span style="color:#f92672"&gt;=&lt;/span&gt; [ &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#e6db74"&gt;"in_memory_authentication.backends.InMemoryAuthenticationBackend"&lt;/span&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;Now if we attempt to login, our custom authentication backend will be called. Of course, we still won’t be able to login since we are always returning &lt;code&gt;None&lt;/code&gt; from our &lt;code&gt;authenticate&lt;/code&gt; method.&lt;/p&gt; 
&lt;p&gt;Let’s change that now.&lt;/p&gt; 
&lt;p&gt;Open up &lt;code&gt;./in_memory_authentication/backends/in_memory_authentication_backend.py&lt;/code&gt; and alter it to:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./in_memory_authentication/backends/in_memory_authentication_backend.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; uuid &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth.backends &lt;span style="color:#f92672"&gt;import&lt;/span&gt; BaseBackend &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth.models &lt;span style="color:#f92672"&gt;import&lt;/span&gt; User &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;InMemoryAuthenticationBackend&lt;/span&gt;(BaseBackend): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;authenticate&lt;/span&gt;(self, request, username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;, password&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Replace this silly logic with whatever you need:&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; username &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;"let_me_in"&lt;/span&gt; &lt;span style="color:#f92672"&gt;and&lt;/span&gt; password &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;"please"&lt;/span&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Create a new user&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user &lt;span style="color:#f92672"&gt;=&lt;/span&gt; User(username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;uuid&lt;span style="color:#f92672"&gt;.&lt;/span&gt;uuid4()&lt;span style="color:#f92672"&gt;.&lt;/span&gt;__str__()) &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user&lt;span style="color:#f92672"&gt;.&lt;/span&gt;set_unusable_password() &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user&lt;span style="color:#f92672"&gt;.&lt;/span&gt;save() &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; new_user &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;else&lt;/span&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;None&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;This is some silly logic, and you should replace it with what you need, but it creates a new User and returns that user, thus logging them in. You should replace this with things like a call to a Dex or Keycloak API, for example.&lt;/p&gt; 
&lt;p&gt;If you now login with the credentials &lt;code&gt;let_me_in&lt;/code&gt; and &lt;code&gt;please&lt;/code&gt;, you should successfully authenticate.&lt;/p&gt; 
&lt;p&gt;Of course, we have not built any pages after the user logs in, so you should get a &lt;code&gt;404 Page not found&lt;/code&gt; error at this stage.&lt;/p&gt; 
&lt;h2&gt;Catering for Custom User Classes&lt;/h2&gt; 
&lt;p&gt;You’ll notice above that I am returning an instance of the &lt;code&gt;django.contrib.auth.models.User&lt;/code&gt; class. However, not all Django projects will use this, and it is therefore better to make use of the &lt;code&gt;get_user_model()&lt;/code&gt; function to find what class this project uses. Further, we can extract the finding of the user into a method:&lt;/p&gt; 
&lt;div class="highlight"&gt; 
 &lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-py"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# ./in_memory_authentication/backends/in_memory_authentication_backend.py&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; uuid &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth.backends &lt;span style="color:#f92672"&gt;import&lt;/span&gt; BaseBackend &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;from&lt;/span&gt; django.contrib.auth &lt;span style="color:#f92672"&gt;import&lt;/span&gt; get_user_model &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;InMemoryAuthenticationBackend&lt;/span&gt;(BaseBackend): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;authenticate&lt;/span&gt;(self, request, username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;, password&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#66d9ef"&gt;None&lt;/span&gt;): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; self&lt;span style="color:#f92672"&gt;.&lt;/span&gt;find_user(username, password) &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# Replace this silly logic with something better, such as an API call to&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#75715e"&gt;# an identity provider:&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;find_user&lt;/span&gt;(self, username, password): &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; username &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;"let_me_in"&lt;/span&gt; &lt;span style="color:#f92672"&gt;and&lt;/span&gt; password &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;"please"&lt;/span&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; user_klass &lt;span style="color:#f92672"&gt;=&lt;/span&gt; get_user_model() &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user &lt;span style="color:#f92672"&gt;=&lt;/span&gt; user_klass(username&lt;span style="color:#f92672"&gt;=&lt;/span&gt;uuid&lt;span style="color:#f92672"&gt;.&lt;/span&gt;uuid4()&lt;span style="color:#f92672"&gt;.&lt;/span&gt;__str__()) &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user&lt;span style="color:#f92672"&gt;.&lt;/span&gt;set_unusable_password() &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; new_user&lt;span style="color:#f92672"&gt;.&lt;/span&gt;save() &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; new_user &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;else&lt;/span&gt;: &lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;None&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; 
&lt;/div&gt; 
&lt;p&gt;That’s it! We’ve successfully created and used our own custom authentication backend in Django.&lt;/p&gt;  
&lt;img src="https://track-eu1.hubspot.com/__ptq.gif?a=139509833&amp;amp;k=14&amp;amp;r=https%3A%2F%2Fpages.melio.ai%2Finsights%2Fdjango-custom-authentication-backends&amp;amp;bu=https%253A%252F%252Fpages.melio.ai%252Finsights&amp;amp;bvt=rss" alt="" width="1" height="1" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important; "&gt;</content:encoded>
      <category>python</category>
      <category>authentication</category>
      <category>django</category>
      <category>medium</category>
      <category>login</category>
      <category>webapp</category>
      <pubDate>Tue, 15 Sep 2026 17:26:36 GMT</pubDate>
      <guid>https://pages.melio.ai/insights/django-custom-authentication-backends</guid>
      <dc:date>2026-09-15T17:26:36Z</dc:date>
      <dc:creator>Admin</dc:creator>
    </item>
    <item>
      <title>Launching Into Uncertainty - 6 Smart Steps to Future-Proof Your ML Models</title>
      <link>https://pages.melio.ai/insights/launching-into-uncertainty</link>
      <description>&lt;div class="hs-featured-image-wrapper"&gt; 
 &lt;a href="https://pages.melio.ai/insights/launching-into-uncertainty" title="" class="hs-featured-image-link"&gt; &lt;img src="https://pages.melio.ai/hubfs/Imported_Blog_Media/cover-4.webp" alt="Launching Into Uncertainty - 6 Smart Steps to Future-Proof Your ML&amp;nbsp;Models" class="hs-featured-image" style="width:auto !important; max-width:50%; float:left; margin:0 15px 15px 0;"&gt; &lt;/a&gt; 
&lt;/div&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Your machine learning model is going to fail in the pandemic. Here’s how to mitigate the&amp;nbsp;damage.&lt;/p&gt; 
&lt;/blockquote&gt;   
&lt;h6&gt;Photo by pch.vector from Freepik.&lt;/h6&gt;   
&lt;p&gt;There have been many articles focusing on how machine learning can and is helping during the pandemic. South Korean and Taiwanese governments successfully demonstrated how they used AI to &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fhbr.org%2F2020%2F04%2Fhow-digital-contact-tracing-slowed-covid-19-in-east-asia"&gt;slow the spread of COVID-19&lt;/a&gt; . French tech company identifying hot spots where masks are not being worn, advising where governments can focus on education. Data and medical professionals collaborating to index medical journal papers on COVID-19.&lt;/p&gt; 
&lt;p&gt;Participation from the data science community is inspiring and the results are outstanding.&lt;/p&gt; 
&lt;p&gt;But this post is about the opposite. I am not here to tout the successes of machine learning. I am here to cast a little doubt on all its glory and wonders. I’m here to ask the question:&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Are you watching your machine learning models during this uncertain time?&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;And why not?&lt;/p&gt;   
&lt;h6&gt;Photo by Stephen Dawson from Unsplash.&lt;/h6&gt;   
&lt;p&gt;Real-life data often diverges from training data. From the day you release the accurate, stable model into production, its performance has been degrading every day as your customers evolve. With COVID-19, it is as if the model is released from the safe, incubated Petri dish to the wild wild west.&lt;/p&gt; 
&lt;p&gt;With the policy changes, the interest rate drops, and the payment holidays, the sudden data shift can have a profound impact on your model. It’s okay to have a decrease in model accuracy, but it is not okay to be ignorant of the changes.&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;It’s okay to have a drop in model accuracy, but it is not okay to be ignorant of the&amp;nbsp;changes&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;For the past couple of weeks, I have been involved in impact assessment for these machine learning models. It was overwhelming initially, so I gathered some practical steps in the hopes that other teams can approach the process with a bit more confidence and a bit less panic:&lt;/p&gt;   
&lt;h6&gt;Photo by Stephen Dawson from Unsplash.&lt;/h6&gt;   
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;h3&gt;Step 1: Identify affected use cases and stakeholders&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;Not all use cases will be affected by the pandemic, like not all models will suffer from &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fmachinelearningmastery.com%2Fgentle-introduction-concept-drift-machine-learning%2F"&gt;data or concept drift&lt;/a&gt; .&lt;/p&gt; 
&lt;p&gt;The first step in any software assessment is the same as the first step in any software development: ask questions.&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;Ask a bunch of questions.&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;If you have many on-going use cases and not sure which to tackle first, begin by asking these:&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;❓ Am I modeling human behavior? (i.e. items purchased during Easter, home loans down payment)&lt;/p&gt; 
&lt;p&gt;❓Did I have any inherent assumptions about the government or corporation policies that have changed during the crisis (i.e. travel bans, payment holiday from the bank)&lt;/p&gt; 
&lt;p&gt;Once you have identified the use cases, then pinpoint the stakeholders affected by these use cases. The stakeholders are often subject matter experts in the domain, so they may be able to assist you in step 2 below.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Draw a decision tree for yourself.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;If your system touched a human or a policy, carry on with Step 2.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Otherwise, move on.&lt;/em&gt;&lt;/p&gt; 
&lt;h3&gt;Step 2: Assess the risks and exposures for when things go&amp;nbsp;wrong&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;This pandemic is a classic case of a black swan event. It’s a rare and unexpected virus outbreak with severe consequences.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;So the chances are, things are going to go wrong, but how wrong?&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;Things are going to go wrong, but just how&amp;nbsp;wrong?&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt; &lt;a href="https://www.kaushik.net/avinash/create-high-impact-effective-data-visualizations/#whatifmodels"&gt;Scenario analysis&lt;/a&gt;  can help us navigate these extreme conditions.&lt;/p&gt; 
&lt;p&gt;Speaking to the SME (subject matter experts) from the business is incredibly valuable in this step. They often have many questions they want answers to, and data scientists would analyze the data to generate insight packs to these questions. This is the time when these questions can help you interrogate your models.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;As an example,&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;“What happens to our bottom line if real estate sales are decimated?”&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Well, this is the time to test it out. If you are modeling the revenue generated from home loans, then examine the data when home loan sales are low (winter months in a summer vacation town). From there, tweak it with the suggestions from the SME and generate a fake input dataset and run it through your model. This can help you assess the areas when the model is at risk.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;Giving a quantitative number can help businesses make tough decisions. Even though we feel like we don’t have enough information to provide a prediction, decisions still have to be made. Loans still need to be granted and toilet papers still need to be shipped. Instead of pushing the responsibilities further along the chain, we should focus on doing the best we can.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Give a prediction with all the asterisks attached to it.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;If the impact is large, proceed to step 3 for a thorough examination.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Otherwise, move on.&lt;/em&gt;&lt;/p&gt; 
&lt;h3&gt;Step 3: Check your entire solution for vulnerabilities&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;Machine learning solutions are more than the model itself. There is the data engineering pipeline, inference, and model retraining. It is important to scan the entire solution end-to-end to find vulnerabilities.&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;Machine learning solution is more than just the&amp;nbsp;model&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Here are some areas you can look at:&lt;/p&gt; 
&lt;p&gt;⏩ Will a bulk quantity break your pipeline? Some supplier’s predictive algorithms were broken by a sudden change in order quantity. On the other hand, some fraud detection systems were overwhelmed by false positives.&lt;/p&gt; 
&lt;p&gt;⏩ Has the baseload on your infrastructure changed? Some models are less relevant and some are even more important, shifting your computing resources can even out the cost.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;⏩ Investigate the global and local feature-importance of your model. Are your top features sensitive to the pandemic? Should they be? There are many articles about explainable AI, and in the time of the unknown, inference explainability could give the transparency people need.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Define checks throughout your entire pipeline.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;By the time you reached Step 3, you already determined that your solution is affected by the crisis. So carry on to Step 4.&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;There is will be no moving on from this point on, only moving forward.&lt;/em&gt;&lt;/p&gt; 
&lt;h3&gt;Step 4: Set up automated alerting and&amp;nbsp;healing&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;If you are reading this article, you probably don’t have monitoring systems in place. Otherwise, you would be setting up 500 Jira tickets and be on top of your next steps.&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;Deploying a machine learning model is like flying an&amp;nbsp;airplane&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;☑️&amp;nbsp;: Having no logging is like flying without a Blackbox. Any terrorist can hijack the plane without any consequences.&lt;/p&gt; 
&lt;p&gt;&#x1f5a5;️&amp;nbsp;: Having no monitoring is like flying blind in new airspace. The pilot has no idea where he’s going, and neither do you.&lt;/p&gt; 
&lt;p&gt;&#x1f32a;️️: Having no resilient infrastructure is like flying with an unmaintained engine. The ticket is cheap but the plane could go down at any time.&lt;/p&gt;    
&lt;h6&gt;Photo by Kaotaru from Unsplash, edited by melio.ai&lt;/h6&gt;   
&lt;p&gt;You won’t board a plane with a blind pilot and a broken engine, why would you deploy a model without logging, monitoring, and resilient infrastructure?&lt;/p&gt; 
&lt;h5&gt;Let’s set aside monitoring, what about&amp;nbsp;healing?&lt;/h5&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Many matured machine learning solutions have automated &lt;a href="https://docs.aws.amazon.com/machine-learning/latest/dg/retraining-models-on-new-data.html"&gt;retraining&lt;/a&gt;  built into the system. But in these extreme events, it may be worth taking a look at the &lt;em&gt;refreshed&lt;/em&gt; models. Are they using the latest data for the prediction? Should they be?&lt;/p&gt; 
&lt;p&gt;Automatically redeploying the refreshed models could be risky when facing the unknown. A human-in-the-loop approach could be both an interim and a strategic solution.&lt;/p&gt; 
&lt;p&gt;1️⃣ Setup automated retraining and reporting (with business KPI as well as the spot checks defined in Step 3).&lt;/p&gt; 
&lt;p&gt;2️⃣ Alert a human for approval, with more stringent alerting criteria during the pandemic period.&lt;/p&gt; 
&lt;p&gt;3️⃣ If Steps 1–3 were conducted rigorously, and the risks and exposures acknowledged, then we may be ready to redeploy the models.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Monitor data and model drift and redeploy if necessary.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;If you are still not sure, set-up &lt;a href="https://martinfowler.com/articles/cd4ml.html"&gt;canary deployment&lt;/a&gt;  and redirect a small portion of your traffic to the new model. Then slowly phase out the old one when the new model is stable.&lt;/em&gt;&lt;/p&gt; 
&lt;h3&gt;Step 5: Unpack and communicate future challenges&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;The COVID-19 impact ranges from short-supply of toilet paper to a meltdown of the global economy. Most if not all industries are affected, either positively or negatively.&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;The abnormality may become the new&amp;nbsp;norm&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Long term effects such as remote working, a surge in bankruptcy, structural unemployment as well as travel restrictions are unclear. When the historical data is not applicable in this unprecedented situation, the “abnormality” may become the new norm. This forces us to go back and unpack the fundamental business question and rethink many assumptions.&lt;/p&gt; 
&lt;p&gt;⏩ Do we include the pandemic data into future model training?&lt;/p&gt; 
&lt;p&gt;⏩ Do we include new features that better reflects the current reality?&lt;/p&gt; 
&lt;p&gt;⏩ Should we tune the model sensitivity when major disruptions occur?&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;⏩ Do we need to re-evaluate the model metrics chosen before the pandemic?&lt;/p&gt; 
&lt;p&gt;⏩ Do we revert all the above when things “return to normal”?&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;There are more questions than answers at this stage. It would be premature to blindly recommend “best practices”.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;The only way is to stay curious, keep communications open, acknowledge risks, and take it one step at a time.&lt;/em&gt;&lt;/p&gt; 
&lt;h3&gt;Step 6: Build fallback systems to mitigate the&amp;nbsp;impact&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;Have you wondered why dung beetles don’t get lost?&lt;/p&gt; 
&lt;p&gt;These tiny insects use a combination of guiding systems to help them achieve the highest precision possible. When one system is not reliable, &lt;a href="https://www.businesslive.co.za/bd/national/science-and-environment/2019-10-29-wits-university-and-lund-university-make-groundbreaking-discovery-about-dung-beetles/"&gt;they switch to use another&lt;/a&gt; .&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;When you don’t have any data, you have to use reason ~Richard&amp;nbsp;Feynman&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;The famous physicist and Nobel Laurette Richard Feynman, on investigating the NASA Challenger program disaster said: “When you don’t have any data, you have to use reason.” (extracted from &lt;a href="https://www.amazon.com/Range-Generalists-Triumph-Specialized-World/dp/0735214484"&gt;Range by David Epstein&lt;/a&gt; , Chapter 9).&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;This particularly rings true when machine learning depends on historical patterns. When historical patterns are not reliable, alternative strategies need to be called upon:&lt;/p&gt; 
&lt;p&gt;⏩ Unsupervised or semi-supervised approaches can help redefine the problem space. Create new segmentations for existing users based on their new behaviors. A past outdoor junkie could be the now mindful yogi.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;⏩ Stress-testing: the scenario analysis framework set up in Step 2 can be used to load various extremes of input data.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;⏩ Ensemble or Choose: Ensembling is popular owing to its ability to create a strong learner by combining multiple weak learners. Sometimes, that may not be necessary. It is possible to have multiple models for one use case. The engineering pipeline can detect changes or attributes, and use the most appropriate model for inference.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Or all the above, with the human-in-the-loop.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;And that is why ladies and gentlemen - AutoML is not going to replace data scientists. Be the voice of reason. Chat to the SMEs. Keep calm and carry on.&lt;/em&gt;&lt;/p&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Navigating changes in this uncertain time is challenging. Nobody is certain of anything, and it can be daunting to make a prediction. Following these steps can guide you through unforeseen problems:&lt;/p&gt; 
&lt;p&gt;1️⃣ Go back to fundamentals, what is this use case about?&lt;/p&gt; 
&lt;p&gt;2️⃣ Question &amp;amp; explain your model&lt;/p&gt; 
&lt;p&gt;3️⃣ Spot check your entire solution&lt;/p&gt; 
&lt;p&gt;4️⃣ Set up logging &amp;amp; monitoring framework&lt;/p&gt; 
&lt;p&gt;5️⃣ Retrain and redeploy&lt;/p&gt; 
&lt;p&gt;6️⃣ Future-proof yourself by staying curious&lt;/p&gt; 
&lt;p&gt;7️⃣ Be the voice of reason, keep calm and carry on&lt;/p&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt;</description>
      <content:encoded>&lt;div class="hs-featured-image-wrapper"&gt; 
 &lt;a href="https://pages.melio.ai/insights/launching-into-uncertainty" title="" class="hs-featured-image-link"&gt; &lt;img src="https://pages.melio.ai/hubfs/Imported_Blog_Media/cover-4.webp" alt="Launching Into Uncertainty - 6 Smart Steps to Future-Proof Your ML&amp;nbsp;Models" class="hs-featured-image" style="width:auto !important; max-width:50%; float:left; margin:0 15px 15px 0;"&gt; &lt;/a&gt; 
&lt;/div&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Your machine learning model is going to fail in the pandemic. Here’s how to mitigate the&amp;nbsp;damage.&lt;/p&gt; 
&lt;/blockquote&gt;   
&lt;h6&gt;Photo by pch.vector from Freepik.&lt;/h6&gt;   
&lt;p&gt;There have been many articles focusing on how machine learning can and is helping during the pandemic. South Korean and Taiwanese governments successfully demonstrated how they used AI to &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fhbr.org%2F2020%2F04%2Fhow-digital-contact-tracing-slowed-covid-19-in-east-asia"&gt;slow the spread of COVID-19&lt;/a&gt; . French tech company identifying hot spots where masks are not being worn, advising where governments can focus on education. Data and medical professionals collaborating to index medical journal papers on COVID-19.&lt;/p&gt; 
&lt;p&gt;Participation from the data science community is inspiring and the results are outstanding.&lt;/p&gt; 
&lt;p&gt;But this post is about the opposite. I am not here to tout the successes of machine learning. I am here to cast a little doubt on all its glory and wonders. I’m here to ask the question:&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;Are you watching your machine learning models during this uncertain time?&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;And why not?&lt;/p&gt;   
&lt;h6&gt;Photo by Stephen Dawson from Unsplash.&lt;/h6&gt;   
&lt;p&gt;Real-life data often diverges from training data. From the day you release the accurate, stable model into production, its performance has been degrading every day as your customers evolve. With COVID-19, it is as if the model is released from the safe, incubated Petri dish to the wild wild west.&lt;/p&gt; 
&lt;p&gt;With the policy changes, the interest rate drops, and the payment holidays, the sudden data shift can have a profound impact on your model. It’s okay to have a decrease in model accuracy, but it is not okay to be ignorant of the changes.&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;It’s okay to have a drop in model accuracy, but it is not okay to be ignorant of the&amp;nbsp;changes&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;For the past couple of weeks, I have been involved in impact assessment for these machine learning models. It was overwhelming initially, so I gathered some practical steps in the hopes that other teams can approach the process with a bit more confidence and a bit less panic:&lt;/p&gt;   
&lt;h6&gt;Photo by Stephen Dawson from Unsplash.&lt;/h6&gt;   
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;h3&gt;Step 1: Identify affected use cases and stakeholders&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;Not all use cases will be affected by the pandemic, like not all models will suffer from &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fmachinelearningmastery.com%2Fgentle-introduction-concept-drift-machine-learning%2F"&gt;data or concept drift&lt;/a&gt; .&lt;/p&gt; 
&lt;p&gt;The first step in any software assessment is the same as the first step in any software development: ask questions.&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;Ask a bunch of questions.&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;If you have many on-going use cases and not sure which to tackle first, begin by asking these:&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;❓ Am I modeling human behavior? (i.e. items purchased during Easter, home loans down payment)&lt;/p&gt; 
&lt;p&gt;❓Did I have any inherent assumptions about the government or corporation policies that have changed during the crisis (i.e. travel bans, payment holiday from the bank)&lt;/p&gt; 
&lt;p&gt;Once you have identified the use cases, then pinpoint the stakeholders affected by these use cases. The stakeholders are often subject matter experts in the domain, so they may be able to assist you in step 2 below.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Draw a decision tree for yourself.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;If your system touched a human or a policy, carry on with Step 2.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Otherwise, move on.&lt;/em&gt;&lt;/p&gt; 
&lt;h3&gt;Step 2: Assess the risks and exposures for when things go&amp;nbsp;wrong&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;This pandemic is a classic case of a black swan event. It’s a rare and unexpected virus outbreak with severe consequences.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;So the chances are, things are going to go wrong, but how wrong?&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;Things are going to go wrong, but just how&amp;nbsp;wrong?&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt; &lt;a href="https://www.kaushik.net/avinash/create-high-impact-effective-data-visualizations/#whatifmodels"&gt;Scenario analysis&lt;/a&gt;  can help us navigate these extreme conditions.&lt;/p&gt; 
&lt;p&gt;Speaking to the SME (subject matter experts) from the business is incredibly valuable in this step. They often have many questions they want answers to, and data scientists would analyze the data to generate insight packs to these questions. This is the time when these questions can help you interrogate your models.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;As an example,&lt;/p&gt; 
&lt;blockquote&gt; 
 &lt;p&gt;“What happens to our bottom line if real estate sales are decimated?”&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;Well, this is the time to test it out. If you are modeling the revenue generated from home loans, then examine the data when home loan sales are low (winter months in a summer vacation town). From there, tweak it with the suggestions from the SME and generate a fake input dataset and run it through your model. This can help you assess the areas when the model is at risk.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;Giving a quantitative number can help businesses make tough decisions. Even though we feel like we don’t have enough information to provide a prediction, decisions still have to be made. Loans still need to be granted and toilet papers still need to be shipped. Instead of pushing the responsibilities further along the chain, we should focus on doing the best we can.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Give a prediction with all the asterisks attached to it.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;If the impact is large, proceed to step 3 for a thorough examination.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;Otherwise, move on.&lt;/em&gt;&lt;/p&gt; 
&lt;h3&gt;Step 3: Check your entire solution for vulnerabilities&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;Machine learning solutions are more than the model itself. There is the data engineering pipeline, inference, and model retraining. It is important to scan the entire solution end-to-end to find vulnerabilities.&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;Machine learning solution is more than just the&amp;nbsp;model&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Here are some areas you can look at:&lt;/p&gt; 
&lt;p&gt;⏩ Will a bulk quantity break your pipeline? Some supplier’s predictive algorithms were broken by a sudden change in order quantity. On the other hand, some fraud detection systems were overwhelmed by false positives.&lt;/p&gt; 
&lt;p&gt;⏩ Has the baseload on your infrastructure changed? Some models are less relevant and some are even more important, shifting your computing resources can even out the cost.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;⏩ Investigate the global and local feature-importance of your model. Are your top features sensitive to the pandemic? Should they be? There are many articles about explainable AI, and in the time of the unknown, inference explainability could give the transparency people need.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Define checks throughout your entire pipeline.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;By the time you reached Step 3, you already determined that your solution is affected by the crisis. So carry on to Step 4.&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;There is will be no moving on from this point on, only moving forward.&lt;/em&gt;&lt;/p&gt; 
&lt;h3&gt;Step 4: Set up automated alerting and&amp;nbsp;healing&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;If you are reading this article, you probably don’t have monitoring systems in place. Otherwise, you would be setting up 500 Jira tickets and be on top of your next steps.&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;Deploying a machine learning model is like flying an&amp;nbsp;airplane&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;☑️&amp;nbsp;: Having no logging is like flying without a Blackbox. Any terrorist can hijack the plane without any consequences.&lt;/p&gt; 
&lt;p&gt;&#x1f5a5;️&amp;nbsp;: Having no monitoring is like flying blind in new airspace. The pilot has no idea where he’s going, and neither do you.&lt;/p&gt; 
&lt;p&gt;&#x1f32a;️️: Having no resilient infrastructure is like flying with an unmaintained engine. The ticket is cheap but the plane could go down at any time.&lt;/p&gt;    
&lt;h6&gt;Photo by Kaotaru from Unsplash, edited by melio.ai&lt;/h6&gt;   
&lt;p&gt;You won’t board a plane with a blind pilot and a broken engine, why would you deploy a model without logging, monitoring, and resilient infrastructure?&lt;/p&gt; 
&lt;h5&gt;Let’s set aside monitoring, what about&amp;nbsp;healing?&lt;/h5&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Many matured machine learning solutions have automated &lt;a href="https://docs.aws.amazon.com/machine-learning/latest/dg/retraining-models-on-new-data.html"&gt;retraining&lt;/a&gt;  built into the system. But in these extreme events, it may be worth taking a look at the &lt;em&gt;refreshed&lt;/em&gt; models. Are they using the latest data for the prediction? Should they be?&lt;/p&gt; 
&lt;p&gt;Automatically redeploying the refreshed models could be risky when facing the unknown. A human-in-the-loop approach could be both an interim and a strategic solution.&lt;/p&gt; 
&lt;p&gt;1️⃣ Setup automated retraining and reporting (with business KPI as well as the spot checks defined in Step 3).&lt;/p&gt; 
&lt;p&gt;2️⃣ Alert a human for approval, with more stringent alerting criteria during the pandemic period.&lt;/p&gt; 
&lt;p&gt;3️⃣ If Steps 1–3 were conducted rigorously, and the risks and exposures acknowledged, then we may be ready to redeploy the models.&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Monitor data and model drift and redeploy if necessary.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;If you are still not sure, set-up &lt;a href="https://martinfowler.com/articles/cd4ml.html"&gt;canary deployment&lt;/a&gt;  and redirect a small portion of your traffic to the new model. Then slowly phase out the old one when the new model is stable.&lt;/em&gt;&lt;/p&gt; 
&lt;h3&gt;Step 5: Unpack and communicate future challenges&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;The COVID-19 impact ranges from short-supply of toilet paper to a meltdown of the global economy. Most if not all industries are affected, either positively or negatively.&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;The abnormality may become the new&amp;nbsp;norm&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Long term effects such as remote working, a surge in bankruptcy, structural unemployment as well as travel restrictions are unclear. When the historical data is not applicable in this unprecedented situation, the “abnormality” may become the new norm. This forces us to go back and unpack the fundamental business question and rethink many assumptions.&lt;/p&gt; 
&lt;p&gt;⏩ Do we include the pandemic data into future model training?&lt;/p&gt; 
&lt;p&gt;⏩ Do we include new features that better reflects the current reality?&lt;/p&gt; 
&lt;p&gt;⏩ Should we tune the model sensitivity when major disruptions occur?&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;⏩ Do we need to re-evaluate the model metrics chosen before the pandemic?&lt;/p&gt; 
&lt;p&gt;⏩ Do we revert all the above when things “return to normal”?&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;There are more questions than answers at this stage. It would be premature to blindly recommend “best practices”.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;The only way is to stay curious, keep communications open, acknowledge risks, and take it one step at a time.&lt;/em&gt;&lt;/p&gt; 
&lt;h3&gt;Step 6: Build fallback systems to mitigate the&amp;nbsp;impact&lt;/h3&gt;   
&lt;h6&gt;Icon from Eucalyp, adapted by Author.&lt;/h6&gt;   
&lt;p&gt;Have you wondered why dung beetles don’t get lost?&lt;/p&gt; 
&lt;p&gt;These tiny insects use a combination of guiding systems to help them achieve the highest precision possible. When one system is not reliable, &lt;a href="https://www.businesslive.co.za/bd/national/science-and-environment/2019-10-29-wits-university-and-lund-university-make-groundbreaking-discovery-about-dung-beetles/"&gt;they switch to use another&lt;/a&gt; .&lt;/p&gt; 
&lt;div class="quote "&gt; 
 &lt;p&gt;When you don’t have any data, you have to use reason ~Richard&amp;nbsp;Feynman&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;The famous physicist and Nobel Laurette Richard Feynman, on investigating the NASA Challenger program disaster said: “When you don’t have any data, you have to use reason.” (extracted from &lt;a href="https://www.amazon.com/Range-Generalists-Triumph-Specialized-World/dp/0735214484"&gt;Range by David Epstein&lt;/a&gt; , Chapter 9).&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;This particularly rings true when machine learning depends on historical patterns. When historical patterns are not reliable, alternative strategies need to be called upon:&lt;/p&gt; 
&lt;p&gt;⏩ Unsupervised or semi-supervised approaches can help redefine the problem space. Create new segmentations for existing users based on their new behaviors. A past outdoor junkie could be the now mindful yogi.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;⏩ Stress-testing: the scenario analysis framework set up in Step 2 can be used to load various extremes of input data.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;⏩ Ensemble or Choose: Ensembling is popular owing to its ability to create a strong learner by combining multiple weak learners. Sometimes, that may not be necessary. It is possible to have multiple models for one use case. The engineering pipeline can detect changes or attributes, and use the most appropriate model for inference.&amp;nbsp;&lt;/p&gt; 
&lt;p&gt;&lt;strong&gt;Or all the above, with the human-in-the-loop.&lt;/strong&gt;&lt;/p&gt; 
&lt;p&gt;&lt;em&gt;And that is why ladies and gentlemen - AutoML is not going to replace data scientists. Be the voice of reason. Chat to the SMEs. Keep calm and carry on.&lt;/em&gt;&lt;/p&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt; 
&lt;p&gt;Navigating changes in this uncertain time is challenging. Nobody is certain of anything, and it can be daunting to make a prediction. Following these steps can guide you through unforeseen problems:&lt;/p&gt; 
&lt;p&gt;1️⃣ Go back to fundamentals, what is this use case about?&lt;/p&gt; 
&lt;p&gt;2️⃣ Question &amp;amp; explain your model&lt;/p&gt; 
&lt;p&gt;3️⃣ Spot check your entire solution&lt;/p&gt; 
&lt;p&gt;4️⃣ Set up logging &amp;amp; monitoring framework&lt;/p&gt; 
&lt;p&gt;5️⃣ Retrain and redeploy&lt;/p&gt; 
&lt;p&gt;6️⃣ Future-proof yourself by staying curious&lt;/p&gt; 
&lt;p&gt;7️⃣ Be the voice of reason, keep calm and carry on&lt;/p&gt; 
&lt;div class="pdivider "&gt; 
 &lt;p&gt;. . .&lt;/p&gt; 
&lt;/div&gt;   
&lt;img src="https://track-eu1.hubspot.com/__ptq.gif?a=139509833&amp;amp;k=14&amp;amp;r=https%3A%2F%2Fpages.melio.ai%2Finsights%2Flaunching-into-uncertainty&amp;amp;bu=https%253A%252F%252Fpages.melio.ai%252Finsights&amp;amp;bvt=rss" alt="" width="1" height="1" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important; "&gt;</content:encoded>
      <category>mlops</category>
      <category>datascience</category>
      <category>medium</category>
      <pubDate>Tue, 15 Sep 2026 17:26:17 GMT</pubDate>
      <guid>https://pages.melio.ai/insights/launching-into-uncertainty</guid>
      <dc:date>2026-09-15T17:26:17Z</dc:date>
      <dc:creator>Admin</dc:creator>
    </item>
  </channel>
</rss>
