<?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: "edisthgirb"[::-1]</title>
    <description>The latest articles on DEV Community by "edisthgirb"[::-1] (@hydrated).</description>
    <link>https://dev.to/hydrated</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%2F453057%2Fe664a521-1340-451c-8cc0-09a94d3b1f53.jpg</url>
      <title>DEV Community: "edisthgirb"[::-1]</title>
      <link>https://dev.to/hydrated</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hydrated"/>
    <language>en</language>
    <item>
      <title>Agile Manifesto: 12 Principles</title>
      <dc:creator>"edisthgirb"[::-1]</dc:creator>
      <pubDate>Thu, 22 Oct 2020 14:19:34 +0000</pubDate>
      <link>https://dev.to/hydrated/agile-manifesto-12-principles-43oh</link>
      <guid>https://dev.to/hydrated/agile-manifesto-12-principles-43oh</guid>
      <description>&lt;h1&gt;
  
  
  The following 12 Principles are based on the Agile Manifesto
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Welcome changing requirements, even late in development. Agile processes harness change for the customer’s competitive advantage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Business people and developers must work together daily throughout the project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Working software is the primary measure of progress.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Continuous attention to technical excellence and good design enhances agility.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simplicity–the art of maximizing the amount of work not done–is essential.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The best architectures, requirements, and designs emerge from self-organizing teams.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's all&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://www.agilealliance.org/agile101/12-principles-behind-the-agile-manifesto/"&gt;https://www.agilealliance.org/agile101/12-principles-behind-the-agile-manifesto/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agile</category>
    </item>
    <item>
      <title>Scheduling tasks using APScheduler in Django</title>
      <dc:creator>"edisthgirb"[::-1]</dc:creator>
      <pubDate>Fri, 18 Sep 2020 13:47:39 +0000</pubDate>
      <link>https://dev.to/hydrated/scheduling-tasks-using-apscheduler-in-django-2dbl</link>
      <guid>https://dev.to/hydrated/scheduling-tasks-using-apscheduler-in-django-2dbl</guid>
      <description>&lt;p&gt;This tutorial deals with showing how to schedule tasks using APScheduler in Django and not with real basics of Python or Django.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Okay, let's start&lt;/em&gt;
&lt;/h3&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Installing APScheduler:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Run the following command in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install apscheduler&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Setting up APScheduler:&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Let's consider the app is named room.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Adding something_update.py to our app directory:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This is how your room/something_update.py should look:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update_something&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;this function runs every 10 seconds&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Adding updater.py to our app directory:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This is how your room/updater.py should look:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;apscheduler.schedulers.background&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BackgroundScheduler&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;.something_update&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;update_something&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;scheduler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BackgroundScheduler&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;scheduler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_job&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;update_something&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;interval&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seconds&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;scheduler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Starting the Updater:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This is how your room/apps.py should look:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;django.apps&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AppConfig&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;RoomConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AppConfig&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;room&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;.&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;updater&lt;/span&gt;
        &lt;span class="n"&gt;updater&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thank you, that's it for this tutorial.&lt;/em&gt;
&lt;/h3&gt;

</description>
      <category>python</category>
      <category>django</category>
      <category>scheduling</category>
      <category>apscheduler</category>
    </item>
    <item>
      <title>Setting up a sample Django Project with PostgreSQL</title>
      <dc:creator>"edisthgirb"[::-1]</dc:creator>
      <pubDate>Wed, 09 Sep 2020 14:14:13 +0000</pubDate>
      <link>https://dev.to/hydrated/setting-up-a-sample-django-project-with-postgresql-4i93</link>
      <guid>https://dev.to/hydrated/setting-up-a-sample-django-project-with-postgresql-4i93</guid>
      <description>&lt;p&gt;This tutorial deals with setting up a sample Django Project with PostgreSQL and not with real basics of Python or Django.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Okay, let's start&lt;/em&gt;
&lt;/h3&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Installing PostgreSQL:&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Search PostgreSQL on google and download it for your OS. (I'm using windows)&lt;/li&gt;
&lt;li&gt;Install PostgreSQL.&lt;/li&gt;
&lt;li&gt;Use the search bar to search pgAdmin and open it.&lt;/li&gt;
&lt;li&gt;It opens up in your browser.&lt;/li&gt;
&lt;li&gt;Create a new server and a new database, name the database 'BookDb' or anything you want.&lt;/li&gt;
&lt;li&gt;You'll need the ENGINE, NAME, USER, PASSWORD, HOST, PORT values later so have them ready.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Setting up a new Django Project:&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Zeroth things zeroth, have Python 3.7 or something installed, explaining how to do that is outside the scope of this tutorial.&lt;/li&gt;
&lt;li&gt;Install Pycharm or any IDE, have a virtualenv set up.&lt;/li&gt;
&lt;li&gt;You'd be building a sample project for book management, we'll be performing crud operations from the django admin site.&lt;/li&gt;
&lt;li&gt;Firstly, Create a new Pycharm project named 'BookDb' or anything you want.&lt;/li&gt;
&lt;li&gt;Then, start a new terminal window, we need to run some commands.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Installing Django and PostgreSQL driver:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Run the following command in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install django psycopg2&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Creating the Django Project:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Run the following command in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;django-admin startproject bookdb .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This creates the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Creating the books app:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Then, create an app. A project can have multiple apps which can be reused in different projects.&lt;/p&gt;

&lt;p&gt;Run the following command in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python manage.py startapp books&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This creates the books app.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Creating the Book model:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This is how your books/models.py should look:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;django.db&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;author&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Adding the books app to settings.py:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Add this to the list of INSTALLED_APPS in settings.py:&lt;br&gt;
&lt;code&gt;'books.apps.BooksConfig'&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Creating the BookAdmin&lt;/strong&gt;:
&lt;/h3&gt;

&lt;p&gt;This is how your books/admin.py should look:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;django.contrib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;.models&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Book&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;BookAdmin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;admin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ModelAdmin&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;list_display&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;author&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="n"&gt;admin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Book&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BookAdmin&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Setting the DATABASES dict in settings.py:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This is how DATABASES in settings.py should probably look:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;DATABASES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;default&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ENGINE&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;django.db.backends.postgresql_psycopg2&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;NAME&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Bookdb&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;USER&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;postgres&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;PASSWORD&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;admin&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;HOST&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;localhost&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;PORT&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;5432&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Running migrations:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Run the following commands in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python manage.py makemigrations&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python manage.py migrate&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Running the project:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Run the following command in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python manage.py runserver&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Creating a superuser:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Start a new terminal window.&lt;/p&gt;

&lt;p&gt;Then, create a superuser using which you can login to the admin site from where you can perform CRUD operations.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python manage.py createsuperuser&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It asks for a username, email address and password. Enter anything you like(and remember the username and password). If it says your password doesn't meet the required validations, just press y.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Logging in to the admin site using the created superuser:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You can see all books, add a new book, update an existing book, delete a new book from there and see the changes being reflected in the PostgreSQL database. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Thank you, that's it for this tutorial.&lt;/em&gt;
&lt;/h3&gt;

</description>
      <category>python</category>
      <category>django</category>
      <category>postgres</category>
      <category>database</category>
    </item>
    <item>
      <title>Terms Explained: Django</title>
      <dc:creator>"edisthgirb"[::-1]</dc:creator>
      <pubDate>Wed, 09 Sep 2020 13:08:05 +0000</pubDate>
      <link>https://dev.to/hydrated/terms-explained-django-18ma</link>
      <guid>https://dev.to/hydrated/terms-explained-django-18ma</guid>
      <description>&lt;p&gt;This article deals with explaining terms related to Django in a short and easy way.&lt;br&gt;
I haven't spent much time writing this, so obviously this isn't the most perfectly formatted thing but still readable enough.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Terms Covered in this article:&lt;/em&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Django&lt;/li&gt;
&lt;li&gt;Framework&lt;/li&gt;
&lt;li&gt;Creating a Django Project&lt;/li&gt;
&lt;li&gt;Apps&lt;/li&gt;
&lt;li&gt;Views&lt;/li&gt;
&lt;li&gt;Models&lt;/li&gt;
&lt;li&gt;Migrations&lt;/li&gt;
&lt;li&gt;Creating Superuser&lt;/li&gt;
&lt;li&gt;Templates&lt;/li&gt;
&lt;li&gt;URL dispatcher&lt;/li&gt;
&lt;li&gt;Forms&lt;/li&gt;
&lt;li&gt;QuerySets&lt;/li&gt;
&lt;li&gt;Working with Django ORM via shell&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Okay, let's start&lt;/em&gt;
&lt;/h3&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Django&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Django is a Web Framework for perfectionists with deadlines.&lt;/li&gt;
&lt;li&gt;It is used to develop fast, scalable, secure websites.&lt;/li&gt;
&lt;li&gt;Popular Websites that are built with Django are Instagram, Spotify, Youtube, Washington Post, and so on.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Framework:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A Framework is a library of reusable modules (building blocks).&lt;/li&gt;
&lt;li&gt;A framework defines a structure for our applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Creating a Django Project:&lt;/strong&gt;
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Creating a book management project:
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;django-admin startproject bookdb .&lt;/code&gt;&lt;br&gt;
&lt;code&gt;python manage.py runserver&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Apps:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Django project can contain multiple apps. &lt;/li&gt;
&lt;li&gt;Apps are functional areas in our Django project. We divide the project into small functional areas for example for a shop, order management, product management, etc. &lt;/li&gt;
&lt;li&gt;We can reuse them across different Django projects.&lt;/li&gt;
&lt;li&gt;For example, Creating a books app: python manage.py startapp books&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Views:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A view function is basically a function that gets called by Django when the user navigates to a particular page. &lt;/li&gt;
&lt;li&gt;For example, from the homepage, when we go to /books, our browser sends an HTTP request to our web server. Django takes that request, inspects the URL, and figures out that we want to see the list of books and it will call a view function and the job of this function is to return the response to the browser/client. So this function should generate some HTML markup to be returned to the client. Our browser will get this HTML content and display it as a page.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Models:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A model is a representation of a real-world concept. &lt;/li&gt;
&lt;li&gt;For example, in a book management system, we can have models like Book, User, Review, and so on.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Migrations:&lt;/strong&gt;
&lt;/h2&gt;

&lt;h4&gt;
  
  
  When we make a new model or modify an existing one:
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;python manage.py makemigrations&lt;/code&gt;&lt;br&gt;
&lt;code&gt;python manage.py migrate&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Creating superuser:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;We have to create a superuser to access the admin panel.&lt;/p&gt;

&lt;h4&gt;
  
  
  Creating superuser:
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;python manage.py createsuperuser&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And then we enter the username, email and password.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Templates:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Using template tag &lt;code&gt;{% %}&lt;/code&gt; in Django we can write dynamic code in Django templates, for example, loops or if statements.&lt;/li&gt;
&lt;li&gt;Whenever we use double curly braces syntax &lt;code&gt;{{ }}&lt;/code&gt; in a Django template, Django evaluates the expression that we put there and render it in HTML.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;URL dispatcher:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A clean URL scheme is important in an important detail in a high-quality web application.&lt;/li&gt;
&lt;li&gt;Django lets us design URLs however we want, with no framework limitations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Django Forms:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;With forms, we have absolute power over our interface.&lt;/li&gt;
&lt;li&gt;We can either define one from scratch or create a ModelForm which will save the result of the form to the model.&lt;/li&gt;
&lt;li&gt;Like every important part of Django, forms have their own file: forms.py&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;QuerySets:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A QuerySet is, in essence, a list of objects of a given Model.&lt;/li&gt;
&lt;li&gt;QuerySets allow you to read the data from the database, filter it, and order it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Working with Django ORM via shell:&lt;/strong&gt;
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Examples for a book app:
&lt;/h4&gt;

&lt;h5&gt;
  
  
  Importing the Model:
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;from books.models import Book&lt;/code&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Getting All Objects:
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;Book.objects.all()&lt;/code&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Adding a New Object:
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;Book.objects.create(name = "Sample Book", author = "Sample author")&lt;/code&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Getting a specific object by field:
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;book = Book.objects.get(id = 1)&lt;/code&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Editing a field of the above object:
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;get_book.author = "Author was edited"&lt;/code&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Saving the edited object:
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;get_book.save()&lt;/code&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Deleting the above object:
&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;get_book.delete()&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Thank you, that's it for this article.&lt;/em&gt;
&lt;/h3&gt;

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