<?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: P Giri Kishore</title>
    <description>The latest articles on DEV Community by P Giri Kishore (@pgirikishore).</description>
    <link>https://dev.to/pgirikishore</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%2F285227%2Fc9ce8298-bd3c-4e57-8e68-62b6a7d37617.jpg</url>
      <title>DEV Community: P Giri Kishore</title>
      <link>https://dev.to/pgirikishore</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pgirikishore"/>
    <language>en</language>
    <item>
      <title>Building gsh: A Minimal Shell in C</title>
      <dc:creator>P Giri Kishore</dc:creator>
      <pubDate>Sun, 29 Jun 2025 16:35:30 +0000</pubDate>
      <link>https://dev.to/pgirikishore/building-gsh-a-minimal-shell-in-c-4g02</link>
      <guid>https://dev.to/pgirikishore/building-gsh-a-minimal-shell-in-c-4g02</guid>
      <description>&lt;p&gt;Earlier this year, I stumbled upon &lt;a href="https://brennan.io/2015/01/16/write-a-shell-in-c/" rel="noopener noreferrer"&gt;Stephen Brennan’s tutorial&lt;/a&gt; on writing a shell in C. It was clear, hands-on, and piqued my interest in Unix internals and systems programming.&lt;/p&gt;

&lt;p&gt;While following along, I started wondering — &lt;em&gt;what if I made this shell more interactive?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That’s how &lt;strong&gt;gsh&lt;/strong&gt; was born: a minimal shell that builds on Brennan’s &lt;code&gt;lsh&lt;/code&gt; with features like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Real-time input using raw terminal mode
&lt;/li&gt;
&lt;li&gt;Arrow-key command history navigation
&lt;/li&gt;
&lt;li&gt;A circular history buffer
&lt;/li&gt;
&lt;li&gt;Modular code structure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this post, I’ll walk you through how it works, why I built it, and what’s coming next.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/pgirikishore/gsh" rel="noopener noreferrer"&gt;Browse the source on GitHub&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Starting Point: Brennan’s Minimal Shell
&lt;/h2&gt;

&lt;p&gt;Brennan’s tutorial provides a compact shell implementation that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reads a line of input using &lt;code&gt;getline()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Splits it into tokens with &lt;code&gt;strtok()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Implements built-ins like &lt;code&gt;cd&lt;/code&gt;, &lt;code&gt;help&lt;/code&gt;, and &lt;code&gt;exit&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Uses &lt;code&gt;fork()&lt;/code&gt; and &lt;code&gt;execvp()&lt;/code&gt; to run external commands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I kept this structure but added a few upgrades:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;Makefile&lt;/code&gt; for easy compilation
&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;shell.h&lt;/code&gt; header for prototypes and constants
&lt;/li&gt;
&lt;li&gt;Better memory safety and error handling&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Handling Input: Raw Mode vs. Canonical Mode
&lt;/h2&gt;

&lt;p&gt;By default, terminals operate in &lt;strong&gt;canonical mode&lt;/strong&gt;, buffering input until Enter is pressed. That makes it impossible to respond to arrow keys and other keys in real time.&lt;/p&gt;

&lt;p&gt;To enable character-by-character input, I switched the shell into &lt;strong&gt;raw mode&lt;/strong&gt; using &lt;code&gt;termios&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;void enable_raw_mode(struct termios *orig) {
    tcgetattr(STDIN_FILENO, orig);
    struct termios raw = *orig;
    raw.c_lflag &amp;amp;= ~(ICANON | ECHO);
    tcsetattr(STDIN_FILENO, TCSAFLUSH, &amp;amp;raw);
}

void disable_raw_mode(struct termios *orig) {
    tcsetattr(STDIN_FILENO, TCSAFLUSH, orig);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are called at the start and end of gsh_read_line() to enable real-time input.&lt;/p&gt;




&lt;h2&gt;
  
  
  Decoding Arrow Keys with Escape Sequences
&lt;/h2&gt;

&lt;p&gt;In raw mode, arrow keys emit escape sequences:&lt;/p&gt;

&lt;p&gt;↑ → &lt;code&gt;ESC [ A&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;↓ → &lt;code&gt;ESC [ B&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To handle this, I read characters one at a time and check for '\x1b' (Escape):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (c == '\x1b') {
    char seq[2];
    seq[0] = getchar();
    seq[1] = getchar();
    if (seq[0] == '[') {
        if (seq[1] == 'A') {
            // Up arrow logic
        } else if (seq[1] == 'B') {
            // Down arrow logic
        }
    }
    continue;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allowed me to respond to arrow presses without needing Enter.&lt;/p&gt;




&lt;h2&gt;
  
  
  Storing Command History: Circular Buffer
&lt;/h2&gt;

&lt;p&gt;I used a circular buffer to store command history:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#define HISTORY_SIZE 100
char *history[HISTORY_SIZE];
int history_head = 0;
int history_size = 0;
int history_index = -1;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the user presses Enter, the command is stored 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;if (history[history_head]) free(history[history_head]);
history[history_head] = strdup(buffer);
history_head = (history_head + 1) % HISTORY_SIZE;
if (history_size &amp;lt; HISTORY_SIZE) history_size++;
history_index = -1;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, we can store up to 100 commands and overwrite old ones as needed.&lt;/p&gt;

&lt;p&gt;Navigating History with ↑ and ↓&lt;br&gt;
When the user presses ↑, we step backward through the buffer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (history_size &amp;gt; 0) {
    if (history_index &amp;lt; history_size - 1) history_index++;
    int idx = (history_head - 1 - history_index + HISTORY_SIZE) % HISTORY_SIZE;
    strcpy(buffer, history[idx]);
    position = strlen(buffer);
    printf("\33[2K\r%s &amp;gt; %s", getcwd(NULL, 0), buffer);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When ↓ is pressed, we move forward toward newer commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (history_index &amp;gt; 0) {
    history_index--;
    // similar index math
} else {
    history_index = -1;
    buffer[0] = '\0';
    position = 0;
    printf("\33[2K\r%s &amp;gt; ", getcwd(NULL, 0));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives a smooth experience like bash/zsh history browsing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Executing Commands
&lt;/h2&gt;

&lt;p&gt;Once input is complete, it’s split into tokens and checked against built-ins:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;char **args = gsh_split_line(line);
if (!strcmp(args[0], "cd")) {
    gsh_cd(args);
} else {
    gsh_launch(args);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;gsh_launch()&lt;/code&gt; uses &lt;code&gt;fork()&lt;/code&gt; and &lt;code&gt;execvp()&lt;/code&gt; to launch programs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pid_t pid = fork();
if (pid == 0) {
    execvp(args[0], args);
    perror("gsh"); exit(EXIT_FAILURE);
} else {
    waitpid(pid, &amp;amp;status, WUNTRACED);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What Works So Far
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Basic shell loop: read → parse → execute&lt;/li&gt;
&lt;li&gt;Built-ins: cd, help, exit&lt;/li&gt;
&lt;li&gt;External command execution&lt;/li&gt;
&lt;li&gt;Arrow key history navigation (↑ / ↓)&lt;/li&gt;
&lt;li&gt;Circular history buffer with wraparound&lt;/li&gt;
&lt;li&gt;Backspace support and basic inline editing&lt;/li&gt;
&lt;li&gt;Clean modular codebase (.c and .h files)&lt;/li&gt;
&lt;li&gt;Build system using Makefile&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What’s Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Left/right arrow support and cursor movement&lt;/li&gt;
&lt;li&gt;Full in-line editing (insert/delete mode)&lt;/li&gt;
&lt;li&gt;Persistent history (.gsh_history) file&lt;/li&gt;
&lt;li&gt;Output redirection (&amp;gt;, &amp;lt;, &amp;gt;&amp;gt;)&lt;/li&gt;
&lt;li&gt;Pipes (|) and background execution (&amp;amp;)&lt;/li&gt;
&lt;li&gt;Tab completion&lt;/li&gt;
&lt;li&gt;A more colorful prompt: user@host:~/dir$&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Credits
&lt;/h2&gt;

&lt;p&gt;Stephen Brennan — Write a Shell in C&lt;br&gt;
Thank you for the amazing tutorial. This project would not exist without it.&lt;/p&gt;



&lt;p&gt;Try It Yourself 💻&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/pgirikishore/gsh.git
cd gsh
make
./gsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start typing commands, then use ↑ and ↓ to navigate your command history.&lt;/p&gt;

&lt;p&gt;Feedback, forks, and pull requests are all welcome!&lt;/p&gt;

</description>
      <category>shell</category>
      <category>terminal</category>
      <category>systems</category>
    </item>
    <item>
      <title>0.1 + 0.2 != 0.3?</title>
      <dc:creator>P Giri Kishore</dc:creator>
      <pubDate>Sun, 20 Feb 2022 13:39:27 +0000</pubDate>
      <link>https://dev.to/pgirikishore/01-02-03-4f8n</link>
      <guid>https://dev.to/pgirikishore/01-02-03-4f8n</guid>
      <description>&lt;p&gt;Can you guess the output of the following code?&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%2Ffg8fii6ol064enjkgc1a.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%2Ffg8fii6ol064enjkgc1a.png" alt="output" width="800" height="827"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you thought the output was "Equal", you're not alone.&lt;/p&gt;

&lt;p&gt;We know computers store data in 0s and 1s (binary format). While integers can be accurately converted to binary format, when it comes to floating point numbers  this conversion is not quite accurate. Numbers such as 1/2, 1/4, 1/8 can be expressed precisely because the denominators use multiple of 2, while other floating point numbers can't be expressed accurately. (For the simplicity of this post, we will not get into the conversion of floating point numbers to binary)&lt;/p&gt;

&lt;p&gt;Since the exact value of such floating point numbers cannot be determined, the processor stores a value close to the actual number in binary format. For this reason we do not get the expected output for any arithmetic operations performed on such floating point numbers.&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%2Fd59yulwbrlspr32csrt3.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%2Fd59yulwbrlspr32csrt3.png" alt="Explanation" width="800" height="825"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>floatingpoint</category>
      <category>double</category>
    </item>
    <item>
      <title>Will Golang replace C/C++?</title>
      <dc:creator>P Giri Kishore</dc:creator>
      <pubDate>Sun, 05 Sep 2021 09:33:38 +0000</pubDate>
      <link>https://dev.to/pgirikishore/will-golang-replace-c-c-3527</link>
      <guid>https://dev.to/pgirikishore/will-golang-replace-c-c-3527</guid>
      <description>&lt;p&gt;Go was developed by a Google team in 2007 to combine the simplicity of Python syntax and semantics with the efficiency of C ++. Although it is not very functional, it is an advanced compiled multithreaded programming language with all the advantages for building distributed systems.&lt;/p&gt;

&lt;p&gt;With the execution speed of Go being comparable with C and C++, will it replace these languages in the distinct future? What's your take on it? Please comment your thoughts. &lt;/p&gt;

</description>
      <category>cpp</category>
      <category>go</category>
    </item>
    <item>
      <title>Getting started with Django - Part 2</title>
      <dc:creator>P Giri Kishore</dc:creator>
      <pubDate>Fri, 01 Jan 2021 19:01:49 +0000</pubDate>
      <link>https://dev.to/pgirikishore/getting-started-with-django-part-2-43oc</link>
      <guid>https://dev.to/pgirikishore/getting-started-with-django-part-2-43oc</guid>
      <description>&lt;p&gt;In the first part of this Django tutorial blog, I had brushed up on what Django is and why developers prefer Django for web development. I had also covered how to install and create a virtual environment and install Django in it. Please refer to my previous blog post &lt;a href="https://pgirikishore.hashnode.dev/getting-started-with-django-part-1" rel="noopener noreferrer"&gt;here&lt;/a&gt; to follow along.&lt;/p&gt;

&lt;p&gt;In this blog post, we will cover how to start a Django project and the file structure of a basic Django project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a project
&lt;/h3&gt;

&lt;p&gt;Creating a Django project is fairly straight forward. Django auto-created the file structure, including database configuration, Django-specific options and application-specific settings. &lt;/p&gt;

&lt;p&gt;From the command line, &lt;code&gt;cd&lt;/code&gt; into a directory where you’d like to store your code, then run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;django-admin startproject mysite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;django-admin&lt;/code&gt; is a command-line utility in Django for administrative tasks. This should create a basic project structure for a Django project in the current directory and the file structure must look like below. If you faced any issue executing the above command, then check &lt;a href="https://docs.djangoproject.com/en/3.1/faq/troubleshooting/#troubleshooting-django-admin" rel="noopener noreferrer"&gt;here&lt;/a&gt; for advice about errors and problems commonly encountered during the development of Django applications.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysite/
    manage.py
    *db.sqlite3*
    mysite/
        __init__.py
        settings.py
        urls.py
        asgi.py
        wsgi.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let me brief you these files and directories that were auto-generated by Django.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Outer mysite&lt;/strong&gt; - Container for your project. Its name doesn’t matter to Django; you can rename it to anything you like.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;manage .py&lt;/strong&gt; - This file is the command-line utility for your Django project. It lets Django developers deploy, debug and test Django projects in development as well as a production environment. This python file contains the code for starting the server, migrating and controlling the project through the command line.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;db.sqlite3&lt;/strong&gt; -    This file might not be present when you execute the &lt;code&gt;startproject&lt;/code&gt; command but will be auto-generated when needed by Django if you're using the SQLite database (Will come back to this point on coming tutorials).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;mysite/&lt;strong&gt;init&lt;/strong&gt;.py&lt;/strong&gt; - An empty file is generated to tell Python that this is a Python package. All Python packages must contain this file to tell Python the entire directory is a package. To know more about Python modules and packages refers to &lt;a href="https://realpython.com/python-modules-packages/" rel="noopener noreferrer"&gt;this article&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;settings.py&lt;/strong&gt; - The setting file contains all the configurations for your Django project. The DJANGO_SETTINGS_MODULE environmental variable tells Django which settings you're using. By default this variable points to the seeting.py file. It can also be changed. This file contains the database settings, a list of all installed apps and middleware, timezone, language code etc. As we keep adding apps onto our Django project, we have to update the setting.py file to keep Django synchronised with the changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;urls.py&lt;/strong&gt; - This file is like the index page for your Django project. In any Django powered website, Django runs through each URL pattern, in order, and stops at the first one that matches the requested URL, matching against requested URL. All such patterns are available at this urls.py file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;wsgi.py&lt;/strong&gt; - WSGI stands for “Web Server Gateway Interface”. It is used to forward requests from a web server to a backend Python web application or framework. The wsgi.py file acts as an entry-point for WSGI-compatible web servers to serve your project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;asgi.py&lt;/strong&gt; - ASGI stands for "Asynchronous Server Gateway Interface". It is a successor to WSGI. The asgi.py file acts as an entry-point for ASGI-compatible web servers to serve your project.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Running the Django server
&lt;/h3&gt;

&lt;p&gt;As mentioned in the previous post, Django comes with a lightweight webserver which can be used for rapid development of Django projects without having the headache of configuring a production server until your site is ready for it.&lt;/p&gt;

&lt;p&gt;We can verify is the Django project that we created is working by running the following command on the command prompt in the project directory&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If you don't encounter any errors on running this command, it means that your server is successfully running. You can visit  &lt;code&gt;http://127.0.0.1:8000/&lt;/code&gt; with your Web browser. You’ll see a “Congratulations!” page, with a rocket taking off. It worked!&lt;/p&gt;

&lt;p&gt;By default, Django uses port 8000. It is possible to change the port along with the server's IP using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python manage.py runserver &amp;lt;ip-address&amp;gt; : &amp;lt;port-number&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! You have successfully created your first Django project. In the next article, we will see how to create apps inside your Django project and link your app to the project.&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Getting started with Django- Part 1</title>
      <dc:creator>P Giri Kishore</dc:creator>
      <pubDate>Mon, 28 Dec 2020 17:02:39 +0000</pubDate>
      <link>https://dev.to/pgirikishore/getting-started-with-django-part-1-3fbc</link>
      <guid>https://dev.to/pgirikishore/getting-started-with-django-part-1-3fbc</guid>
      <description>&lt;h2&gt;
  
  
  What is Django?
&lt;/h2&gt;

&lt;p&gt;Django is a high-level, open-source Python Web development framework used for building rapid maintainable websites with clean pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. Django was built by Adrian Holovaty and Simon Willison at Lawrence Journal-World newspaper back in 2003-2004. The whole story of why and how they built Django is answered by Simon Willison on a &lt;a href="https://www.quora.com/What-is-the-history-of-the-Django-web-framework-Why-has-it-been-described-as-developed-in-a-newsroom/answer/Simon-Willison" rel="noopener noreferrer"&gt;Quora post&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Django?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Administrative GUI&lt;/strong&gt; - One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Object Relational Mapping (ORM) Support&lt;/strong&gt; - Django provides a bridge between the data model and the database engine, and supports a large set of database systems including MySQL, Oracle, Postgres, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Development Environment&lt;/strong&gt; - Django comes with a lightweight web server for an end to end application development and testing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installing Django
&lt;/h2&gt;

&lt;p&gt;Assuming you already have the latest version of Python installed on your machine, we go ahead and create a virtual environment. &lt;/p&gt;

&lt;h3&gt;
  
  
  Virtual Environment
&lt;/h3&gt;

&lt;p&gt;A virtual environment is a python module that creates a unique environment for each project or task, having its own version of python modules required to run the specific project or tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing and creating a virtual environment
&lt;/h3&gt;

&lt;p&gt;We can install a virtual environment by using the Python Package manager &lt;code&gt;pip&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;pip install virtualenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Having installed virtualenv, the next step is to &lt;em&gt;create&lt;/em&gt; a virtual environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m venv &amp;lt;virtual-environment-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now a virtual environment is created. We have to implicitly activate the virtual environment each time we use it. We can do that by using the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the virtual environment setup has been completed. We can go ahead and install Django onto our machine by again using the Python Package manager &lt;code&gt;pip&lt;/code&gt; and verify it by typing the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install Django
python -m django --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Django is successfully installed you should be able to see the version of Django installed. If it throws an error then you see the official documentation &lt;a href="https://docs.djangoproject.com/en/3.1/topics/install/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's it for this tutorial. We will see how to start a Django project and create apps inside our Django project in the next tutorial.&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to download Instagram posts using python.</title>
      <dc:creator>P Giri Kishore</dc:creator>
      <pubDate>Mon, 06 Jul 2020 17:36:55 +0000</pubDate>
      <link>https://dev.to/pgirikishore/how-to-download-instagram-posts-using-python-38mb</link>
      <guid>https://dev.to/pgirikishore/how-to-download-instagram-posts-using-python-38mb</guid>
      <description>&lt;h2&gt;
  
  
  Hello Everyone!
&lt;/h2&gt;

&lt;p&gt;In this post I will show you guys how to download posts from instagram using Command prompt of a machine with python installed&lt;/p&gt;




&lt;p&gt;Install the &lt;strong&gt;instaloader&lt;/strong&gt; library. We can do this using the Python Package installer &lt;strong&gt;pip&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;$ pip install instaloader
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;[1] To download all pictures and videos of a profile, as well as the profile picture of a &lt;strong&gt;public&lt;/strong&gt; account, do&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ instaloader thepracticaldev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also pass a list of profiles by entering the profiles inside [].&lt;/p&gt;




&lt;p&gt;[2] To download all pictures and videos of a profile, as well as the profile picture of a &lt;strong&gt;private&lt;/strong&gt; account, do&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ instaloader --login=&amp;lt;your-username&amp;gt; thepracticaldev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also pass a list of profiles by entering the profiles inside []. You can only download the pictures and videos from the profiles you follow on instagram.&lt;/p&gt;




&lt;p&gt;[3] To download a &lt;strong&gt;single post&lt;/strong&gt;, do&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ instaloader -- -&amp;lt;post’s-shortcode&amp;gt;
$ instaloader -- -CByYyUMAhhY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;[4] To download current stories, feed, saved contents and hashtags, do&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ instaloader --login=&amp;lt;your-username&amp;gt; :stories
$ instaloader --login=&amp;lt;your-username&amp;gt; :feed
$ instaloader --login=&amp;lt;your-username&amp;gt; :saved
$ instaloader --login=&amp;lt;your-username&amp;gt; "#hashtag"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Leave your queries in the comment section&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Library Creator: &lt;a href="https://github.com/instaloader/instaloader" rel="noopener noreferrer"&gt;https://github.com/instaloader/instaloader&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>productivity</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
