<?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: Mohamed</title>
    <description>The latest articles on DEV Community by Mohamed (@amraoui_mohamed).</description>
    <link>https://dev.to/amraoui_mohamed</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%2F1254577%2F3efc94bc-e8e8-49f9-8b3f-060faf5eed42.jpg</url>
      <title>DEV Community: Mohamed</title>
      <link>https://dev.to/amraoui_mohamed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amraoui_mohamed"/>
    <language>en</language>
    <item>
      <title>Behind the Scenes: Building My Modular Django Portfolio - PART 1</title>
      <dc:creator>Mohamed</dc:creator>
      <pubDate>Tue, 22 Jul 2025 07:06:45 +0000</pubDate>
      <link>https://dev.to/amraoui_mohamed/behind-the-scenes-building-my-modular-django-portfolio-part-1-283o</link>
      <guid>https://dev.to/amraoui_mohamed/behind-the-scenes-building-my-modular-django-portfolio-part-1-283o</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Keeping your portfolio up to date is a must for every developer. After launching my first SaaS project, I realized it was time to refresh my own.&lt;/p&gt;

&lt;p&gt;To make the process more enjoyable, I went with a vibe-driven development flow — building intuitively and having fun with it. Here are the tools that shaped the journey:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://gemini.google.com/" rel="noopener noreferrer"&gt;Gemini&lt;/a&gt;: for brainstorming and UI design ideas.
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://cursor.com/" rel="noopener noreferrer"&gt;Cursor Code Editor&lt;/a&gt;: to write and refactor code with AI assistance.
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.djangoproject.com/" rel="noopener noreferrer"&gt;Django framework&lt;/a&gt;: a powerful framework for building full-stack websites.
&lt;/li&gt;
&lt;li&gt;Custom coding: for fixing the bugs made by AI assistants.
&lt;/li&gt;
&lt;li&gt;JavaScript: to bring interactivity to the frontend — from smooth transitions to dynamic components.
&lt;/li&gt;
&lt;li&gt;Bootstrap 5 (&lt;a href="https://getbootstrap.com/):" rel="noopener noreferrer"&gt;https://getbootstrap.com/):&lt;/a&gt; to speed up UI layout with prebuilt components and a solid grid system.
&lt;/li&gt;
&lt;li&gt;CSS3: for fine-tuning styles, animations, and giving the site its own personality.
&lt;/li&gt;
&lt;li&gt;Font Awesome(&lt;a href="https://fontawesome.com/):" rel="noopener noreferrer"&gt;https://fontawesome.com/):&lt;/a&gt; because icons speak louder than text sometimes (and it just looks slick).&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Once I had my tools and mindset in place, I focused on setting up the project structure. My goal was to keep the code clean, modular, and easy to maintain — especially for future edits.&lt;/p&gt;

&lt;p&gt;To achieve that, I broke down the system into small, focused components — what I call "mini apps." Each handled a specific part of the functionality, making the codebase easier to scale and debug.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
├── core &lt;span class="c"&gt;# My Core application that ill hold all the project configs &lt;/span&gt;
│   ├── asgi.py
│   ├── __init__.py
│   ├── __pycache__
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── dashboard &lt;span class="c"&gt;# The dashboard application for admin and landing page content&lt;/span&gt;
│   ├── admin.py
│   ├── apps.py
│   ├── context_processors
│   ├── __init__.py
│   ├── migrations
│   ├── models
│   ├── __pycache__
│   ├── static
│   ├── templates
│   ├── tests.py
│   ├── urls.py
│   └── views
├── frontend &lt;span class="c"&gt;# the portfolio's UI: Landing page, projects, blog&lt;/span&gt;
│   ├── admin.py
│   ├── apps.py
│   ├── __init__.py
│   ├── migrations
│   ├── models.py
│   ├── __pycache__
│   ├── static
│   ├── templates
│   ├── tests.py
│   ├── urls.py
│   └── views
├── manage.py
├── README.md
├── requirements.txt
├── static
└── user_auth &lt;span class="c"&gt;# Basic User auth application (Login system)&lt;/span&gt;
    ├── admin.py
    ├── apps.py
    ├── __init__.py
    ├── migrations
    ├── models.py
    ├── __pycache__
    ├── static
    ├── templates
    ├── tests.py
    ├── urls.py
    └── views
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Next Steps:
&lt;/h2&gt;

&lt;p&gt;Setting up the project to ensure clean, readable code is the first step in every successful build.&lt;br&gt;&lt;br&gt;
Coding comes next. In the following part, I’ll walk you through how I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generated a fully responsive landing page
&lt;/li&gt;
&lt;li&gt;Built a fully responsive dashboard
&lt;/li&gt;
&lt;li&gt;Fixed errors made by AI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Any Questions?:&lt;/strong&gt; drop it down and lets discuss &lt;/p&gt;

&lt;p&gt;Stay tuned for the next part  &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>django</category>
      <category>programming</category>
    </item>
    <item>
      <title>download manager using python</title>
      <dc:creator>Mohamed</dc:creator>
      <pubDate>Wed, 17 Jul 2024 07:04:36 +0000</pubDate>
      <link>https://dev.to/amraoui_mohamed/download-manager-using-python-20h3</link>
      <guid>https://dev.to/amraoui_mohamed/download-manager-using-python-20h3</guid>
      <description>&lt;p&gt;I just found this amazing #python library for managing downloads with a great features. &lt;br&gt;
I liked it a lot so i decided to share it with you.&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%2Fdvgk649gdvlyzmsrn8wi.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%2Fdvgk649gdvlyzmsrn8wi.png" alt=" " width="800" height="762"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Auth via E-mail: Overriding Django's default auth system</title>
      <dc:creator>Mohamed</dc:creator>
      <pubDate>Sat, 30 Mar 2024 08:53:20 +0000</pubDate>
      <link>https://dev.to/amraoui_mohamed/auth-via-e-mail-overriding-djangos-default-auth-system-3a75</link>
      <guid>https://dev.to/amraoui_mohamed/auth-via-e-mail-overriding-djangos-default-auth-system-3a75</guid>
      <description>&lt;p&gt;Django framework provides a great mechanism to authenticate users via their username and password, but what if you need to implement a custom auth where you have to authenticate via the email instead? &lt;br&gt;
This Guide covers the steps to create a custom user auth for you project&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Creating your auth.py&lt;/strong&gt;:
first of all inside you app directory create a file named auth.py, that's where we're gonna override the default authentication behavior.&lt;/li&gt;
&lt;li&gt;*** Overriding the default authenticate method***:
inside you auth.py file paste the following code:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.contrib.auth.backends import BaseBackend
from django.contrib.auth import get_user_model

class CustomUserAuth(BaseBackend):
    def __init__(self) :
        # get the custom user model we've already created
        self.UserModel = get_user_model()
        # overriding the authenticate  method to include our own logic for authentication
    def authenticate(self, request, username=None,password=None,**kwargs):
        # retrieve the username
        username = kwargs.get('username')
        if username:
            try :
                # treat the username as email if it contain @
                if '@' in username:
                    user = self.UserModel.objects.get(email=username)
                # if it doesnt treat it as a username
                else:
                    user = self.UserModel.objects.get(username=username)
                # check the password that's included on the request 
                # and return user object if its true
                if user.check_password(password):
                    return user
                else :
                    return None
            except Exception as e:
                return None
    # a function to get the user object
    def get_user(self, user_id):
        try:
            return self.UserModel.objects.get(pk=user_id)
        except self.UserModel.DoesNotExist:
            return None
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Tell django about the new settings&lt;/em&gt;&lt;/strong&gt;:
return to your settings.py and add this line:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
AUTHENTICATION_BACKENDS = [
    'relative/path/tp/your/auth.py'
]

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

&lt;/div&gt;



&lt;p&gt;this line will tell django that we've created our own authentication login and that we're going to use it &lt;/p&gt;

&lt;p&gt;And that it, your custom authentication should now work either by email or useraname&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>django</category>
      <category>api</category>
      <category>backenddevelopment</category>
    </item>
    <item>
      <title>Creating APIs : introducing the beginner friendly framework</title>
      <dc:creator>Mohamed</dc:creator>
      <pubDate>Wed, 06 Mar 2024 07:03:28 +0000</pubDate>
      <link>https://dev.to/amraoui_mohamed/creating-apis-introducing-the-beginner-friendly-framework-1efh</link>
      <guid>https://dev.to/amraoui_mohamed/creating-apis-introducing-the-beginner-friendly-framework-1efh</guid>
      <description>&lt;p&gt;Recently i got hired for working with local development agency to create a dashboard with its API, but i was struggling writing the API, testing it and writing its docs. &lt;br&gt;
Until i discovered the new &lt;strong&gt;django ninja&lt;/strong&gt;  3rd party library and it really amused me. Where beside of creating the API and writing it it allows you to even test it locally from your web browser.&lt;br&gt;
&lt;strong&gt;Django ninja&lt;/strong&gt; gives every developer to create the desired API with less coding and simpler syntax &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%2Flxq2c765h2rwlzmv4y99.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%2Flxq2c765h2rwlzmv4y99.png" alt=" " width="800" height="460"&gt;&lt;/a&gt;&lt;br&gt;
and with using the propre URL routing you can choose the URL path of every ENDPOINT &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%2F8od582q11sgwhcmzub3a.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%2F8od582q11sgwhcmzub3a.png" alt=" " width="800" height="203"&gt;&lt;/a&gt;&lt;br&gt;
so using a the less coding you can achieve all what you desire on your API&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%2Ffggjdy6q73dnf3qlju0y.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%2Ffggjdy6q73dnf3qlju0y.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>django</category>
      <category>api</category>
      <category>backend</category>
    </item>
    <item>
      <title>React Vs Flutter: what's the best option?</title>
      <dc:creator>Mohamed</dc:creator>
      <pubDate>Fri, 12 Jan 2024 11:10:20 +0000</pubDate>
      <link>https://dev.to/amraoui_mohamed/react-vs-flutter-whats-the-best-option-4g3e</link>
      <guid>https://dev.to/amraoui_mohamed/react-vs-flutter-whats-the-best-option-4g3e</guid>
      <description>&lt;p&gt;A while ago, I wanted to be a mobile application developer and that made me confused about which stack I must go along with.&lt;br&gt;
After some googling I found that React Native and Flutter are my best options but that made me more confused, and I start asking about which one is best for me as a Django backend Developer.&lt;br&gt;
thereafter I decided to go with React for some reasons that I'll mention:&lt;br&gt;
1 - Learning React Native will make you obliged to Learn JS and all its framework Including ReactJs &lt;br&gt;
2 - React Native allow you to code once and publish your application for Android and IOS ( cross platform )&lt;br&gt;
3 - React Native provides developer the control over the native components of the OS&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>react</category>
      <category>mobile</category>
    </item>
    <item>
      <title>My Journey with ReactJs</title>
      <dc:creator>Mohamed</dc:creator>
      <pubDate>Thu, 11 Jan 2024 20:02:10 +0000</pubDate>
      <link>https://dev.to/amraoui_mohamed/my-journey-with-reactjs-2j7e</link>
      <guid>https://dev.to/amraoui_mohamed/my-journey-with-reactjs-2j7e</guid>
      <description>&lt;p&gt;Hello Guys. &lt;br&gt;
am a newbie to this amazing platform and i want to share you my latest progress on the ReactJs Learning path, and the picture shows the result of studying 4 hours.&lt;br&gt;
What do you think? what are you learning currently ?&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%2F8hrvr3llb2fxlfymcdn0.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%2F8hrvr3llb2fxlfymcdn0.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
