<?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: Digvijay Singh </title>
    <description>The latest articles on DEV Community by Digvijay Singh  (@digvijay_singhrajput).</description>
    <link>https://dev.to/digvijay_singhrajput</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%2F1734261%2Ff8cbd54d-40b7-4624-ad5c-14082ec26462.png</url>
      <title>DEV Community: Digvijay Singh </title>
      <link>https://dev.to/digvijay_singhrajput</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/digvijay_singhrajput"/>
    <language>en</language>
    <item>
      <title>How to Reset the PostgreSQL `postgres` Password (Forgot Password Fix)</title>
      <dc:creator>Digvijay Singh </dc:creator>
      <pubDate>Fri, 13 Mar 2026 06:03:50 +0000</pubDate>
      <link>https://dev.to/digvijay_singhrajput/how-to-reset-the-postgresql-postgres-password-forgot-password-fix-3hd</link>
      <guid>https://dev.to/digvijay_singhrajput/how-to-reset-the-postgresql-postgres-password-forgot-password-fix-3hd</guid>
      <description>&lt;p&gt;For many developers working with PostgreSQL locally, forgetting the postgres user password is very common.&lt;/p&gt;

&lt;p&gt;When trying to connect using pgAdmin or psql, you might see an error like:&lt;/p&gt;

&lt;p&gt;connection failed: FATAL: password authentication failed for user "postgres"&lt;/p&gt;

&lt;p&gt;This guide shows a simple method to reset the password on Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1) Locate the PostgreSQL Configuration File&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Navigate to the PostgreSQL data folder:&lt;/p&gt;

&lt;p&gt;C:\Program Files\PostgreSQL\16\data&lt;/p&gt;

&lt;p&gt;Find the file:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; pg_hba.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This file controls how PostgreSQL authenticates users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2) Open pg_hba.conf&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open the file using Notepad as Administrator.&lt;/p&gt;

&lt;p&gt;Find these lines:&lt;/p&gt;

&lt;p&gt;local   all             all                                  scram-sha-256&lt;br&gt;
host    all             all             127.0.0.1/32         scram-sha-256&lt;br&gt;
host    all             all             ::1/128              scram-sha-256&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3) Temporarily Disable Password Authentication&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Change scram-sha-256 to trust.&lt;/p&gt;

&lt;p&gt;local   all             all                                     trust&lt;br&gt;
host    all             all             127.0.0.1/32            trust&lt;br&gt;
host    all             all             ::1/128                 trust&lt;/p&gt;

&lt;p&gt;Save the file.&lt;/p&gt;

&lt;p&gt;This temporarily allows login without a password.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4) Restart PostgreSQL Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Press Windows + R&lt;/p&gt;

&lt;p&gt;Type:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services.msc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Find the service:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; postgresql-x64-16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Restart the service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5) Open SQL Shell (psql)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Search for:&lt;/p&gt;

&lt;p&gt;SQL Shell (psql)&lt;/p&gt;

&lt;p&gt;Press Enter for all default values:&lt;/p&gt;

&lt;p&gt;Server [localhost]:&lt;br&gt;
Database [postgres]:&lt;br&gt;
Port [5432]:&lt;br&gt;
Username [postgres]:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6) Reset the Password&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the command:&lt;/p&gt;

&lt;p&gt;ALTER USER postgres PASSWORD 'newpassword123';&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;ALTER USER postgres PASSWORD 'MySecurePassword';&lt;/p&gt;

&lt;p&gt;If successful, you will see:&lt;/p&gt;

&lt;p&gt;ALTER ROLE&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7) Restore Security&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go back to pg_hba.conf and change:&lt;/p&gt;

&lt;p&gt;trust&lt;/p&gt;

&lt;p&gt;back to:&lt;/p&gt;

&lt;p&gt;scram-sha-256&lt;/p&gt;

&lt;p&gt;Restart PostgreSQL again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8) Connect Again&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now connect using pgAdmin:&lt;/p&gt;

&lt;p&gt;Username: postgres&lt;br&gt;
Password: newpassword123&lt;br&gt;
Port: 5432&lt;/p&gt;

&lt;p&gt;The connection should work successfully.&lt;/p&gt;

&lt;p&gt;✅ Final Notes&lt;/p&gt;

&lt;p&gt;Use trust only temporarily&lt;/p&gt;

&lt;p&gt;Always restore scram-sha-256&lt;/p&gt;

&lt;p&gt;This method works for most local PostgreSQL installations on Windows&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>database</category>
      <category>webdev</category>
      <category>backend</category>
    </item>
    <item>
      <title>Customizing the Django Panel: A Step-By-Step Guide</title>
      <dc:creator>Digvijay Singh </dc:creator>
      <pubDate>Wed, 18 Sep 2024 17:17:12 +0000</pubDate>
      <link>https://dev.to/digvijay_singhrajput/customizing-the-django-panel-a-step-by-step-guide-c17</link>
      <guid>https://dev.to/digvijay_singhrajput/customizing-the-django-panel-a-step-by-step-guide-c17</guid>
      <description>&lt;p&gt;In this guide I'll walk you through how to modify and extend Django default admin panel/interface, making it more user-friendly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Set up the Project:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Start by creating a brand new project and app in Django&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;django-admin startproject myprojectname
cd myprojectname
python manage.py startapp developerscommunity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;** Note**&lt;br&gt;
Do not forgot to add your app ti the INSTALLED_APPS in settings.py&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Run migrations:&lt;/strong&gt;&lt;/p&gt;

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

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;3. Resgister Models in Admin Panel:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Register of models is compulsory to see it in django admin 
 interface

  from django.contrib import admin
  from .models import DevCommunity

 admin.site.register(DevCommunity)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Above Steps will lead you to Django Admin Panel Now comes the customization part&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Customize the Admin Panel:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;class CustomAdminSite(admin.AdminSite):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;will appear at the top-left corner&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;site_header = "Dev  Admin"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;will show in the browser tab&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;site_title = Developer Admin Portal &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;will be displayed on the admin home page.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;index_title = "Welcome to Developer Community" &lt;/p&gt;

&lt;p&gt;custom_admin_site = CustomAdminSite(name="dev_admin")&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  #All code at one place
  class CustomAdminSite(admin.AdminSite):
     site_header = "Dev  Admin"
     site_title = Developer Admin Portal
     index_title = "Welcome to Developer Community"

  custom_admin_site = CustomAdminSite(name="dev_admin")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;5. To register:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  #Finally register
  custom_admin_site.register(DevCommunity)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F3e1bsd0004xyq3ofyscp.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%2F3e1bsd0004xyq3ofyscp.PNG" alt=" " width="444" height="143"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>backend</category>
      <category>webdev</category>
      <category>django</category>
      <category>python</category>
    </item>
    <item>
      <title>Django File Structure for Developers</title>
      <dc:creator>Digvijay Singh </dc:creator>
      <pubDate>Mon, 16 Sep 2024 18:19:14 +0000</pubDate>
      <link>https://dev.to/digvijay_singhrajput/django-file-structure-for-developers-4i68</link>
      <guid>https://dev.to/digvijay_singhrajput/django-file-structure-for-developers-4i68</guid>
      <description>&lt;p&gt;This django file structure guide will walk you through the essential elements of a django project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Contents&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Project Root Directory&lt;/li&gt;
&lt;li&gt;Project Directory (e.g., you_project_name)&lt;/li&gt;
&lt;li&gt;Applications (Apps)&lt;/li&gt;
&lt;li&gt;Templates Directory&lt;/li&gt;
&lt;li&gt;Static Directory&lt;/li&gt;
&lt;li&gt;Media Directory&lt;/li&gt;
&lt;li&gt;Virtual Environment (venv/)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;1. Project Root Directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This directory contains the entire Django project. It contains&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- manage.py&lt;/strong&gt;: It is a command line utility that allows us to interact with project. Mainly use to start development server, create apps, run migrations etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Project Folder&lt;/strong&gt; (Your Project name folder): It contains setting and configurations of our project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Project Directory (e.g., you_project_name)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a folder that has configurations for our Django projects. It include files like:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- init.py&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- settings.py&lt;/strong&gt;: Contains setting for our projects such as configurations, database settings, installed apps, allowed hosts, middleware.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- urls.py&lt;/strong&gt;: It contains URL for our projects (Routing requests for our views).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- asgi.py&lt;/strong&gt;: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- wsgi.py&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Applications (Apps)&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- models.py&lt;/strong&gt;: It contains Data Structure for you project or we can say app's data/ structure of the database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- views.py&lt;/strong&gt;: Business logic (handling requests and responses)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- urls.py&lt;/strong&gt;: your app specific url&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- forms.py&lt;/strong&gt;: structure and validation logic for the forms&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- admin.py&lt;/strong&gt;: Django admin panel(Dashboard) by registering the models (by creating a superuser and login to the Django's admin) &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- apps.py&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- migrations/&lt;/strong&gt;: Contains database migrations files.Each time you make any changes to your database you will see a new file with some random naes in this folder (e.g. 0001_initial, 0002_model_you_made_or_changes, ...)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Templates Directory&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- base.html&lt;/strong&gt;:This contains shared code which is common in many files for example headers, footers which you want in your multiple pages.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;- other files that extend from base.html for specific views *&lt;/em&gt;: Lets say login.html, home.html etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Static Directory&lt;/strong&gt;:It contains static files such as CSS, JavaScript, images. App specific directories or global one (as per your requirements).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Media Directory&lt;/strong&gt;: User uploaded files for example documents, any other files may be a profile picture of a user etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Virtual Environment (venv/)&lt;/strong&gt;: Make a habit of creating a virtual environment for each of the django project to isolate project dependencies. It is important to note that it is essential for project specific packages without disturbing any global environment.&lt;/p&gt;

&lt;p&gt;your_project_name/&lt;br&gt;
│&lt;br&gt;
├── manage.py&lt;br&gt;
├── your_project_name/&lt;br&gt;
│   ├── &lt;strong&gt;init&lt;/strong&gt;.py&lt;br&gt;
│   ├── settings.py&lt;br&gt;
│   ├── urls.py&lt;br&gt;
│   ├── wsgi.py&lt;br&gt;
│   └── asgi.py&lt;br&gt;
│&lt;br&gt;
├── your_app_one/&lt;br&gt;
│   ├── &lt;strong&gt;init&lt;/strong&gt;.py&lt;br&gt;
│   ├── admin.py&lt;br&gt;
│   ├── apps.py&lt;br&gt;
│   ├── models.py&lt;br&gt;
│   ├── views.py&lt;br&gt;
│   ├── urls.py&lt;br&gt;
│   └── migrations/&lt;br&gt;
│&lt;br&gt;
├── your_app_two/&lt;br&gt;
│   ├── &lt;strong&gt;init&lt;/strong&gt;.py&lt;br&gt;
│   ├── admin.py&lt;br&gt;
│   ├── apps.py&lt;br&gt;
│   ├── models.py&lt;br&gt;
│   ├── views.py&lt;br&gt;
│   └── migrations/&lt;br&gt;
│&lt;br&gt;
├── templates/&lt;br&gt;
│   ├── base.html&lt;br&gt;
│   └── home.html&lt;br&gt;
│&lt;br&gt;
└── static/&lt;br&gt;
    ├── css/&lt;br&gt;
    └── js/&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Understanding file structure before starting any projects in any language is very crucial and essential for efficient project development. I hope now it becomes easier for you all to navigate and manage your code bases.&lt;/p&gt;

&lt;p&gt;Please feel free to comment your thoughts or any tips.&lt;br&gt;
&lt;strong&gt;If you want all essential django commands at one place please comment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BONUS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Commands that you should know for manage.py&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    **1. python manage.py runserver ** : To start the server

    **2. python manage.py makemigrations** : Creating new 
         migrations on the changes made in your models.

    **3. python manage.py migrate ** : Applying or unapplying 
         migrations
    **4. python manage.py createsuperuser**: Access to django 
         admin panel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>django</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
