<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Naftali M</title>
    <description>The latest articles on DEV Community by Naftali M (@naftal_m).</description>
    <link>https://dev.to/naftal_m</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1258246%2F7201f15d-f62e-4896-9727-d5c4f2cb9cfe.png</url>
      <title>DEV Community: Naftali M</title>
      <link>https://dev.to/naftal_m</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/naftal_m"/>
    <language>en</language>
    <item>
      <title>Intellectual Capacity and the Impacts of Generative AI</title>
      <dc:creator>Naftali M</dc:creator>
      <pubDate>Thu, 12 Jun 2025 17:33:50 +0000</pubDate>
      <link>https://dev.to/naftal_m/intellectual-capacity-and-the-impacts-of-generative-ai-2f91</link>
      <guid>https://dev.to/naftal_m/intellectual-capacity-and-the-impacts-of-generative-ai-2f91</guid>
      <description>&lt;p&gt;Intellectual capacity refers to the ability of individuals to think, reason, analyze, and generate ideas. It encompasses both creative and critical thinking abilities, forming the foundation of innovation, education, and scientific advancement. With the rapid development and integration of generative artificial intelligence (GenAI) into various domains, questions have emerged regarding the effects on human intellectual capacity, the opportunities and challenges to creativity and critical thinking, and the implications for intellectual property (IP). This article explores these dimensions, highlighting the benefits and limitations of GenAI while considering future directions and regulatory concerns related to intellectual property.&lt;/p&gt;

&lt;p&gt;Generative AI systems  capable of producing text, images, music, code, and more based on learned patterns from data has transformed the way people interact with information and express creativity. Tools such as OpenAI’s ChatGPT, Google’s Gemini, and image generators like Midjourney can enhance human productivity and serve as intellectual partners in brainstorming, content creation, and problem-solving. They can augment intellectual capacity in a variety of ways.&lt;/p&gt;

&lt;p&gt;GenAI helps users overcome writer’s block, generate artistic concepts, and prototype ideas rapidly. According to McCormack et al. (2020), creative AI systems can act as co-creators, expanding human imagination across various aspects. While GenAI may be seen as a shortcut, it can stimulate critical reflection when used properly. Users are often prompted to verify, refine, or question AI-generated content, which can encourage deeper engagement with information.&lt;/p&gt;

&lt;p&gt;However, there are significant concerns regarding the overreliance on AI, which may lead to the diminishment of original thought and intellectual autonomy. Carr (2010) warned about the "Google effect" where dependence on external tools reduces memory retention and analytical rigor. With GenAI, this concern is magnified, especially in educational settings where students might bypass learning processes by using AI-generated essays and answers.&lt;/p&gt;

&lt;p&gt;Despite the benefits, the creative and critical use of GenAI raises several pressing issues:&lt;br&gt;
Works created with the aid of GenAI blur the lines between human and machine authorship. Who owns the rights to a painting generated by AI trained on hundreds of human artists? Courts and IP offices are grappling with these questions. In Thaler v. Perlmutter (2023), the U.S. Copyright Office ruled that purely AI-generated works cannot be copyrighted, reinforcing the principle that copyright requires human authorship.&lt;br&gt;
GenAI tools are only as unbiased as their training data. They may reproduce and amplify societal biases or misinformation embedded in their data sets (Bender et al., 2021). When used uncritically, this can reinforce stereotypes and lead to flawed decision-making.&lt;br&gt;
In academic settings, Generative AI introduces complex challenges in identifying plagiarism. Although AI-generated content is not typically copied verbatim, it often rephrases established ideas or unintentionally reflects existing works, thereby complicating assessments of originality. The issue becomes more pronounced when students who frequently rely on GenAI attempt to write independently; they are likely to adopt the AI's distinctive voice and tone, potentially blurring the line between original thought and machine influence.&lt;/p&gt;

&lt;p&gt;GenAI models, such as GPT, do not comprehend content like humans do. Instead, they operate by statistically predicting the most likely sequence of words based on the input they receive and the patterns they’ve learned from massive datasets. These models are trained on large text corpora and identify patterns, but they do not possess consciousness, intent, or actual understanding of meaning. When responding, they simply generate what appears likely to follow based on training data — not what is factually or contextually accurate. As a result the outputs are plausible-sounding but factually incorrect, logically inconsistent, or entirely fabricated. This is known as &lt;strong&gt;AI hallucination&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;GenAI technologies can be misused, raising serious ethical concerns. Malicious actors can manipulate GenAI to automatically generate large volumes of misleading or false information that may influence public opinion, elections, or social unrest. This is generally encountered in creation of deepfake scripts, fake academic essays, or hate speech, particularly when guardrails are bypassed or weak. Excessive use of GenAI can lead to intellectual laziness and overreliance, especially among students or professionals who substitute critical thinking with machine assistance. Instead of engaging deeply with content, users might rely on AI to form arguments, solve problems, or write essays. This weakens the development of essential skills like analysis, synthesis, and creative thinking. As a result Users may begin to trust GenAI outputs without question a phenomenon known as automation bias even when the content is inaccurate or misleading. In the long run, reliance on AI-generated content without reflection can degrade research capabilities, writing proficiency, and cognitive development, especially in learning environments.&lt;/p&gt;

&lt;p&gt;In conclusion generative AI has revolutionized the intellectual landscape by enhancing human creativity and critical thinking while simultaneously posing challenges to originality, authenticity, and legal frameworks. The intellectual capacity of humans is not necessarily diminished by GenAI, but it is redefined—dependent on how individuals and societies choose to engage with the technology. Balancing augmentation with autonomy, innovation with integrity, and automation with accountability is key. In the long run, thoughtful regulation and ethical AI practices are essential to ensure that intellectual property laws remain relevant and fair in a rapidly changing digital age.&lt;/p&gt;

&lt;p&gt;References&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;    Bender, E. M., Gebru, T., McMillan-Major, A., &amp;amp; Shmitchell, S. (2021). On the Dangers of Stochastic Parrots: Can Language Models Be Too Big?. FAccT.&lt;/li&gt;
&lt;li&gt;    Carr, N. (2010). The Shallows: What the Internet Is Doing to Our Brains. W. W. Norton &amp;amp; Company.&lt;/li&gt;
&lt;li&gt;    McCormack, J., Gifford, T., &amp;amp; Hutchings, P. (2020). Autonomy, Authenticity, and Authorship in AI-generated Art. Proceedings of ICCC.&lt;/li&gt;
&lt;li&gt;    OpenAI. (2023). GPT-4 Technical Report. &lt;a href="https://openai.com/research/gpt-4" rel="noopener noreferrer"&gt;https://openai.com/research/gpt-4&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;    Thaler v. Perlmutter, No. 1:22-cv-01564 (D.D.C. 2023).&lt;/li&gt;
&lt;li&gt;    Getty Images (US), Inc. v. Stability AI, Inc., No. 1:23-cv-00135 (D. Del. 2023).&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Outlier detection and handling in R</title>
      <dc:creator>Naftali M</dc:creator>
      <pubDate>Tue, 29 Apr 2025 08:35:57 +0000</pubDate>
      <link>https://dev.to/naftal_m/outlier-detection-and-handling-in-r-3b8b</link>
      <guid>https://dev.to/naftal_m/outlier-detection-and-handling-in-r-3b8b</guid>
      <description>&lt;p&gt;An &lt;strong&gt;outlier&lt;/strong&gt; is a data point that significantly differs from other observations in a dataset. It can be:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;- Unusually high or low compared to the rest of the data.&lt;/li&gt;
&lt;li&gt;- Anomalous due to measurement errors, data entry mistakes, or rare events.&lt;/li&gt;
&lt;li&gt;- A true extreme value that represents natural variation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example of data set&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;name of the loaded data is Data&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F75cjiylckxgvo5oniab0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F75cjiylckxgvo5oniab0.png" alt="Image description" width="800" height="39"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How to identify outliers
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;basic summary function
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;summary(Data)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;Visual methods (using Box plot)&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Plot age on a box plot&lt;br&gt;
&lt;code&gt;boxplot(Data$Age, main = "Age",col = "skyblue")&lt;/code&gt;&lt;br&gt;
output&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9tz4dqwkn2g6x8g413n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9tz4dqwkn2g6x8g413n.png" alt="Image description" width="800" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Plot Net_worth on a box plot&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;boxplot(Data$Net_worth, main ="Networth in *10000 PLN",col = "orange")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;Using interquatile range&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Identify the outlier on age values&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Q1 &amp;lt;- quantile(Data$Age, 0.25)
Q3 &amp;lt;- quantile(Data$Age, 0.75)
IQR &amp;lt;- Q3 - Q1
lower_bound_age &amp;lt;- Q1 - 1.5 * IQR
upper_bound_age &amp;lt;- Q3 + 1.5 * IQR
outlier_age &amp;lt;- Data$Age[Data$Age &amp;lt; lower_bound_age | Data$Age &amp;gt; upper_bound_age]
print(outlier_age)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;output&lt;br&gt;
93&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Identify the outlier on Net_worth values&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Q1 &amp;lt;- quantile(Data$Net_worth, 0.25)
Q3 &amp;lt;- quantile(Data$Net_worth, 0.75)
IQR &amp;lt;- Q3 - Q1
lower_bound_Net_worth &amp;lt;- Q1 - 1.5 * IQR
upper_bound_Net_worth &amp;lt;- Q3 + 1.5 * IQR
outlier_networth &amp;lt;- Data$Net_worth[Data$Net_worth &amp;lt; lower_bound_Net_worth | Data$Net_worth &amp;gt; upper_bound_Net_worth]
print(outlier_networth)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;output&lt;br&gt;
152000&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  SOLVING THE OUTLIER
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Droping the outliers using the interquartile range
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new_data &amp;lt;- Data[
  Data$Net_worth &amp;gt;= lower_bound_Net_worth &amp;amp; Data$Net_worth &amp;lt;= upper_bound_Net_worth &amp;amp;
  Data$Age &amp;gt;= lower_bound_age &amp;amp; Data$Age &amp;lt;= upper_bound_age, 
]

summary(new_data)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;Substituting the outliers with column mean&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;identify the row index for outliers&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# check the data row
which(Data$Net_worth== 152000 )
which(Data$Age== 93)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;output&lt;br&gt;
12, 10&lt;/p&gt;

&lt;p&gt;Replace the outliers with the means&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Replace the data points with the mean
Data$Net_worth[12] &amp;lt;- mean(Data$Net_worth)
Data$Age[10] &amp;lt;- mean(Data$Age)
summary(Data)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;plot the new data columns on a box plot&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;boxplot(Data$Age, 
        main = "Age", 
        col = "green", 
        border = "blue")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;boxplot(Data$Net_worth, 
        main = "Networth in *10000 PLN", 
        col = "yellow", 
        border = "blue")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;/p&gt;

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

</description>
    </item>
    <item>
      <title>USER REGISTRATION &amp; AUTHENTICATION USING DJANGO.</title>
      <dc:creator>Naftali M</dc:creator>
      <pubDate>Fri, 02 Aug 2024 14:31:58 +0000</pubDate>
      <link>https://dev.to/naftal_m/user-registration-authentication-using-django-ajl</link>
      <guid>https://dev.to/naftal_m/user-registration-authentication-using-django-ajl</guid>
      <description>&lt;p&gt;This project will guide you through creating users using Django's default forms, registering users, authenticating users via the login form, and displaying certain pages only for authenticated users. You also can logout the user&lt;/p&gt;

&lt;p&gt;Create project, and respective apps&lt;br&gt;
Register your application in the settings.py file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSTALLED_APPS = [
    'your_app', 
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create super user.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Create the template folder and have the following html pages&lt;br&gt;
&lt;strong&gt;Base.html&lt;/strong&gt; – contains all code that is extended to other html pages&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;

    &amp;lt;title&amp;gt;User&amp;lt;/title&amp;gt;
    &amp;lt;link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"&amp;gt;
&amp;lt;script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;link rel="stylesheet" href="#"&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class="container"&amp;gt;
        &amp;lt;div class="card text-center mt-3"&amp;gt;
            &amp;lt;div class="card-header"&amp;gt;
              &amp;lt;ul class="nav nav-tabs card-header-tabs"&amp;gt;
                &amp;lt;li class="nav-item"&amp;gt;
                  &amp;lt;a class="nav-link "  href="#"&amp;gt;Home&amp;lt;/a&amp;gt;
                &amp;lt;/li&amp;gt;
                &amp;lt;li class="nav-item"&amp;gt;
                  &amp;lt;a class="nav-link "  href="{%url 'register'%}"&amp;gt;Sign Up&amp;lt;/a&amp;gt;
                &amp;lt;/li&amp;gt;
                &amp;lt;li class="nav-item"&amp;gt;
                  &amp;lt;a class="nav-link "  href="{%url 'signin'%}"&amp;gt;Login&amp;lt;/a&amp;gt;
                &amp;lt;/li&amp;gt;
              &amp;lt;/ul&amp;gt;
              &amp;lt;div class="card-body bg-info "&amp;gt;

                {% block content%}

                {%endblock%}
            &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt; 
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Home.html – contains code for our landing page&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{%extends 'base.html'%}
{%block content%}
&amp;lt;h2&amp;gt;Welcome to user creation form&amp;lt;/h2&amp;gt;
{%endblock%}

Register.html – contains code that renders the registration form
{%extends 'base.html'%}
{%block content%}
&amp;lt;h2&amp;gt;Registration Page&amp;lt;/h2&amp;gt;
                 &amp;lt;form action="" method="post"&amp;gt;
                    {% csrf_token %}
                    &amp;lt;!--1 {{form}}  Default django form --&amp;gt;
                     &amp;lt;!-- {{form.as_p}} --&amp;gt;

                    {{form.username.label}}{{form.username}}
                    &amp;lt;br&amp;gt;
                    {{form.email.label}} {{form.email}}
                    &amp;lt;br&amp;gt;
                    {{form.password1.label}} {{form.password1}}
                    &amp;lt;br&amp;gt;
                    {{form.password2.label}} {{form.password2}}
                    &amp;lt;br&amp;gt;
                    &amp;lt;!-- add bootstrap form controls here --&amp;gt;
                    &amp;lt;!-- &amp;lt;form &amp;gt;
                        &amp;lt;div class="form-group" style="width: 400px;"&amp;gt;
                          &amp;lt;label for="formGroupExampleInput"&amp;gt;username&amp;lt;/label&amp;gt;
                          {{form.username}}
                        &amp;lt;br&amp;gt;
                          &amp;lt;label for="formGroupExampleInput2"&amp;gt;Email&amp;lt;/label&amp;gt;
                          {{form.email}}
                          &amp;lt;br&amp;gt;
                          &amp;lt;label for="formGroupExampleInput"&amp;gt;password&amp;lt;/label&amp;gt;
                          {{form.password1}}
                          &amp;lt;br&amp;gt;
                          &amp;lt;label for="formGroupExampleInput2"&amp;gt;Confirm password&amp;lt;/label&amp;gt;
                          {{form.password2}}
                        &amp;lt;/div&amp;gt;
                      &amp;lt;/form&amp;gt; --&amp;gt;
                    &amp;lt;input type="submit"&amp;gt;
                    &amp;lt;!-- show any errors --&amp;gt;
                    {{form.errors}}

                    &amp;lt;p&amp;gt;Already have an account &amp;lt;a href="{%url 'signin'%}"&amp;gt;Login&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
                 &amp;lt;/form&amp;gt;
{%endblock%}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Login page&lt;/strong&gt; – contains code for the login interface&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{%extends 'base.html'%}
{%block content%}
&amp;lt;p&amp;gt;Login form&amp;lt;/p&amp;gt;
&amp;lt;form action="" method="POST"&amp;gt;
    {% csrf_token %}
    &amp;lt;div class="form-group"&amp;gt;
      &amp;lt;label for=""&amp;gt;Username&amp;lt;/label&amp;gt;
      &amp;lt;input type="text" class="form-control" id="" name="username" placeholder="Username"&amp;gt;

      &amp;lt;label for=""&amp;gt;password&amp;lt;/label&amp;gt;
      &amp;lt;input type="password" class="form-control" id="" name="password" placeholder="password"&amp;gt;

    &amp;lt;/div&amp;gt;
    &amp;lt;input type="submit" value="submit"&amp;gt;
    &amp;lt;p&amp;gt;Don't have an acccount &amp;lt;a href="{%url 'register'%}"&amp;gt;Sign Up&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;

    &amp;lt;!-- display message --&amp;gt;
     {% for message in messages%}
        &amp;lt;p&amp;gt;{{message}}&amp;lt;/p&amp;gt;

     {%endfor%}
  &amp;lt;/form&amp;gt;
{%endblock%}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Form.py&lt;/strong&gt; – this form helps us to override the basic Django user form and add our own email fields&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms

#custom user 
class CreateUserForm(UserCreationForm):
    class Meta:
        model = User
        fields = ['username', 'email', 'password1', 'password2']

urls.py – All our urls are registered to this file

from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [

   path("home/", views.home, name="home"),
   path("signin/", views.signin, name="signin"),
   path("register/", views.register, name="register"),
   path("dashboard/", views.dashboard, name="dashboard"),
   path("logout/", views.logout, name="logout"),
]

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Views.py&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.shortcuts import render, redirect
from django.http import HttpResponse
from .forms import CreateUserForm

#using messages
from django.contrib import messages
# handle login form
from django.contrib.auth import login, authenticate, logout
from django.contrib.auth.forms import UserCreationForm

#resctrict access to some pages 
from django.contrib.auth.decorators import login_required
def home(request):
    # return HttpResponse('Hello Learns!!!')
    return render(request, 'home.html')

def register(request):
    form = CreateUserForm()
    if request.method == 'POST':
        form = CreateUserForm(request.POST)
        if form.is_valid():
            form.save()
            #get username 
            user = form.cleaned_data.get('username')
            messages.success(request, 'Account succefully created for ' + user)
            # After user has registered take them to login page
            return redirect('signin')
    context = {'form': form}
    #return HttpResponse('Hello Learns!!!')
    return render(request, "register.html", context)

# def register(request):
#     form = UserCreationForm()
#     if request.method == 'POST':
#         form = UserCreationForm(request.POST)
#         if form.is_valid():
#             form.save()
#     context = {'form': form}
#     #return HttpResponse('Hello Learns!!!')
#     return render(request, "register.html", context)


# Create your views here.
def signin(request):
    if request.method == 'POST':
        username = request.POST.get('username')
        password = request.POST.get('password')

        user = authenticate(request, username=username, password=password)

        if user is not None:
            login(request, user)
            return redirect('dashboard')
        else:
            messages.info(request, 'Username or Password is incorrect')

    context = {}
    return render(request, 'login.html', context)

def logout(request): 
    return redirect('home')

@login_required(login_url='signin')
def dashboard(request):
    return render(request, 'dashboard.html')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To get the project code on github: &lt;a href="https://github.com/NaftalyMurimi/UserRegistration_Authentication" rel="noopener noreferrer"&gt;Naftaly&lt;/a&gt;&lt;/p&gt;

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