<?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: Kundan Bhardwaj</title>
    <description>The latest articles on DEV Community by Kundan Bhardwaj (@kundanbhardwaj145).</description>
    <link>https://dev.to/kundanbhardwaj145</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%2F640920%2F4d5b944d-330c-497e-99a1-3c4a18b36f63.png</url>
      <title>DEV Community: Kundan Bhardwaj</title>
      <link>https://dev.to/kundanbhardwaj145</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kundanbhardwaj145"/>
    <language>en</language>
    <item>
      <title>How to integrate Tailwind CSS(v4) with Django.</title>
      <dc:creator>Kundan Bhardwaj</dc:creator>
      <pubDate>Tue, 04 Mar 2025 10:35:44 +0000</pubDate>
      <link>https://dev.to/kundanbhardwaj145/how-to-integrate-tailwind-cssv4-with-django-3g02</link>
      <guid>https://dev.to/kundanbhardwaj145/how-to-integrate-tailwind-cssv4-with-django-3g02</guid>
      <description>&lt;p&gt;Django is an awesome framework and sometimes we don't like to write the CSS files separately so in that scenario we can use an CSS framework packed with classes like &lt;code&gt;flex, pt-4, text-center&lt;/code&gt; and &lt;code&gt;rotate-90&lt;/code&gt; that can be composed to build any design, directly in your markup. Yes you are right it's Tailwind CSS.&lt;br&gt;
Using Tailwind CSS can significantly reduce the number of static files in your project.&lt;/p&gt;
&lt;h2&gt;
  
  
  In order to use Tailwind CSS with Django you have to follow the steps given below :
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;initialize a django project.&lt;/li&gt;
&lt;li&gt;initialize npm and install tailwindcss.&lt;/li&gt;
&lt;li&gt;make static directory.&lt;/li&gt;
&lt;li&gt;create templates.&lt;/li&gt;
&lt;li&gt;add views and urls.&lt;/li&gt;
&lt;li&gt;Start the Tailwind CLI build process.&lt;/li&gt;
&lt;li&gt;Start the development server.&lt;/li&gt;
&lt;li&gt;More...&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Initialization of django project &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;In the beginning we will open the terminal and make a django project using command &lt;code&gt;django-admin startproject myproject&lt;/code&gt; after this we will &lt;code&gt;cd&lt;/code&gt; into our project, In this case command will be &lt;code&gt;cd myproject&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Create an app inside your project by executing &lt;code&gt;python manage.py startapp myapp&lt;/code&gt;.&lt;br&gt;
Include the app inside &lt;code&gt;INSTALLED_APPS&lt;/code&gt; in &lt;code&gt;settings.py&lt;/code&gt; file.&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%2Fwt5vp8ijaqe6zb95r2ge.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%2Fwt5vp8ijaqe6zb95r2ge.png" alt=" " width="618" height="291"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Installing Tailwind CSS  &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;To use Tailwind CSS we need to install two npm packages &lt;code&gt;tailwindcss&lt;/code&gt; and &lt;code&gt;@tailwindcss/cli&lt;/code&gt; and for that we have to initialize this project with npm using the command &lt;code&gt;npm init -y&lt;/code&gt; this command will create &lt;code&gt;package.json&lt;/code&gt; for us.&lt;/p&gt;

&lt;p&gt;Now install the packages using command given below.&lt;br&gt;
&lt;code&gt;npm install tailwindcss @tailwindcss/cli&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Make static a directory &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;In order to save static files create an empty folder named &lt;code&gt;static&lt;/code&gt; in root directory and use following settings in your &lt;code&gt;settings.py&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;STATIC_URL = 'static/'
STATICFILES_DIRS = [BASE_DIR / "static"]
STATIC_ROOT = BASE_DIR / "staticfiles"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;inside this &lt;code&gt;static&lt;/code&gt; folder create another folder called &lt;code&gt;src&lt;/code&gt; and inside src create a file named &lt;code&gt;input.css&lt;/code&gt;.&lt;br&gt;
the &lt;code&gt;input.css&lt;/code&gt; file should have the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@import "tailwindcss";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Make templates &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;To organize our HTML we will create a empty directory called &lt;code&gt;templates&lt;/code&gt; in root folder and add  it in our &lt;code&gt;settings.py&lt;/code&gt; like this 👇🏻&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%2F9bu73lxuvsdz0ofubj8y.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%2F9bu73lxuvsdz0ofubj8y.png" alt=" " width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we will create a html file called &lt;code&gt;index.html&lt;/code&gt; which will contain following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{% load static %}
&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;Django + Tailwind CSS v4&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class="container mx-auto bg-gray-100 py-10"&amp;gt;
        &amp;lt;h1 class="text-4xl font-bold text-center text-green-700 ml-30"&amp;gt;Django + Tailwind CSS v4&amp;lt;/h&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;h2&gt;
  
  
  Define views and add urls &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;your &lt;code&gt;views.py&lt;/code&gt; should look like this.&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

def index(request):
    return render(request, 'index.html')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;your &lt;code&gt;urls.py&lt;/code&gt; should look like this.&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 import admin
from django.urls import path
from myapp.views import index

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index, name='index'),
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Start the Tailwind CLI build process &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Open a terminal window and start the tailwind cli build process by executing command &lt;code&gt;npx @tailwindcss/cli -i ./static/src/input.css -o ./static/src/output.css --watch&lt;/code&gt; this generate an file named &lt;code&gt;output.css&lt;/code&gt; in the &lt;code&gt;src&lt;/code&gt; directory which is specified earlier.&lt;/p&gt;

&lt;p&gt;⚠️ make sure you do not close the above window during your development process so that tailwind cli can compile the tailwindcss code everytime we write.&lt;/p&gt;

&lt;p&gt;now add that &lt;code&gt;output.css&lt;/code&gt; into your &lt;code&gt;index.html&lt;/code&gt; by adding following line in head &lt;code&gt;&amp;lt;link rel="stylesheet" href="{% static '/src/output.css' %}"&amp;gt;&lt;/code&gt;. your &lt;code&gt;index.html&lt;/code&gt; should look like this 👇🏻&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{% load static %}
&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;Django + Tailwind CSS v4&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="{% static '/src/output.css' %}"&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class="container mx-auto bg-gray-100 py-10"&amp;gt;
        &amp;lt;h1 class="text-4xl font-bold text-center text-green-700 ml-30"&amp;gt;Django + Tailwind CSS v4&amp;lt;/h&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;h2&gt;
  
  
  Now start the development server &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Now you can start the development server by &lt;code&gt;python manage.py runserver&lt;/code&gt; and you will be able to see following 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%2F8e7wiwdxtda687fm1kxz.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%2F8e7wiwdxtda687fm1kxz.png" alt=" " width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  More...
&lt;/h2&gt;

&lt;p&gt;moreover you can refer official &lt;a href="https://tailwindcss.com/docs/" rel="noopener noreferrer"&gt;tailwindcss v4 documentation&lt;/a&gt; for more details like how to add dark mode and custom classes etc.&lt;/p&gt;

&lt;p&gt;Thank You for reading the full blog.&lt;/p&gt;

</description>
      <category>python</category>
      <category>django</category>
      <category>webdev</category>
      <category>tailwindcss</category>
    </item>
    <item>
      <title>why you should learn from documentation ?</title>
      <dc:creator>Kundan Bhardwaj</dc:creator>
      <pubDate>Thu, 13 Feb 2025 13:28:47 +0000</pubDate>
      <link>https://dev.to/kundanbhardwaj145/why-you-should-learn-from-documentation--37a</link>
      <guid>https://dev.to/kundanbhardwaj145/why-you-should-learn-from-documentation--37a</guid>
      <description>&lt;h1&gt;
  
  
  introduction
&lt;/h1&gt;

&lt;p&gt;Hello folks 👋🏻 let's know why it is important to learn from documentation instead of tutorials or Gen AI tools.&lt;/p&gt;

&lt;h1&gt;
  
  
  table of contents
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Which technology do you want to learn ?&lt;/li&gt;
&lt;li&gt;What is your experience level ?&lt;/li&gt;
&lt;li&gt;Why documentation ?&lt;/li&gt;
&lt;li&gt;How to learn effectively ?&lt;/li&gt;
&lt;li&gt;Dark mode&lt;/li&gt;
&lt;li&gt;Conclusion.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Which technology do you want to learn ? &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Learning a technology can take time. Some technologies have simple documentation  while some don't, for example people find &lt;a href="https://docs.djangoproject.com/" rel="noopener noreferrer"&gt;Django&lt;/a&gt; docs tough. The reason behind this is the domain of the technology i.e Django is a backend framework and has a complex architecture. On the other hand there are also simple documentations like &lt;a href="https://tailwindcss.com/docs/" rel="noopener noreferrer"&gt;Tailwind CSS&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is your experience level ? &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;If you are a absolute beginner you should clear your basics from tutorials and make something working by yourself and then you can jump in to the documentation.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why documentation ? &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Based on my personal experience I was very confused with react state management what I have done is opened &lt;a href="https://react.dev/learn/" rel="noopener noreferrer"&gt;React Documentation&lt;/a&gt;&lt;br&gt;
there I found a very good explanation of react states using tic-tac-toe game which saved my hours of hopping through random learning material.&lt;/p&gt;

&lt;h1&gt;
  
  
  Main advantages &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Makes deep understanding&lt;/strong&gt; - if you want to get deep understanding of some 
technology you should check documentations out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Saves Time&lt;/strong&gt; - because it takes less time to read docs. as compared to 
watching tutorials.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Always Updated&lt;/strong&gt; - Technologies are updated regularly, as a result 
sometimes what we learn from online resources do not match the current version 
of that technology and you get stuck. But documentations consist of all the 
versions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  How to learn effectively &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Almost every documentation is written in similar manner. So here i will take &lt;a href="https://docs.djangoproject.com/en/5.1/" rel="noopener noreferrer"&gt;'Django documentation'&lt;/a&gt; as reference.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Go to the &lt;strong&gt;Table of Contents&lt;/strong&gt; section of the documentation.&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%2Fvx0y4jxmxlq7bkuhhog7.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%2Fvx0y4jxmxlq7bkuhhog7.png" alt="'Image description'" width="796" height="603"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you are a beginner there would be a starter tutorial for sure in our case we have &lt;strong&gt;Django at a Glance&lt;/strong&gt;.&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%2Fdfjkwly9lbubn0qngsfv.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%2Fdfjkwly9lbubn0qngsfv.png" alt="'Image description'" width="756" height="440"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;By following the starter tutorial make something by yourself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you already know something about that technology you can use &lt;code&gt;Ctrl+K&lt;/code&gt; to search some specific term.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Feffx3l0x9vatrlqw7xw2.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%2Feffx3l0x9vatrlqw7xw2.png" alt="'Image description'" width="778" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  How to force dark mode &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Sometimes dark mode is not available on the documentations like &lt;a href="https://graphene-python.org/" rel="noopener noreferrer"&gt;graphene-python&lt;/a&gt; and if you prefer dark mode you can force dark mode on any website by just enabling the dark mode option in &lt;code&gt;chrome://flags&lt;/code&gt; as shown in the picture.&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%2Fjpjd0jt3qx9iy2vga340.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%2Fjpjd0jt3qx9iy2vga340.png" alt=" " width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  conclusion &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;Use the typography and the navigations in the documentation effectively you will  be able to understand the technology very well.  &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>ai</category>
      <category>python</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
