<?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>Forem: Sm0ke</title>
    <description>The latest articles on Forem by Sm0ke (@sm0ke).</description>
    <link>https://forem.com/sm0ke</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%2F152613%2Ff6aadb36-121c-409f-b746-e40e0408ea51.png</url>
      <title>Forem: Sm0ke</title>
      <link>https://forem.com/sm0ke</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sm0ke"/>
    <language>en</language>
    <item>
      <title>Dynamic Data Tables Concept in Flask</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Sat, 22 Feb 2025 16:06:21 +0000</pubDate>
      <link>https://forem.com/sm0ke/dynamic-data-tables-concept-in-flask-39c7</link>
      <guid>https://forem.com/sm0ke/dynamic-data-tables-concept-in-flask-39c7</guid>
      <description>&lt;p&gt;This article explains the &lt;a href="https://app-generator.dev/blog/dynamic-data-tables-concept-in-flask/" rel="noopener noreferrer"&gt;Dynamic Data Table&lt;/a&gt; Pattern and how it can be used to manage information with ease via pagination, search, and filters without any coding effort. For newcomers, Dynamic Programming is a method for solving complex problems by breaking them down into simpler subproblems.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Free Sample that incorporates the concept&lt;/code&gt;: &lt;a href="https://app-generator.dev/product/datta-able/flask/" rel="noopener noreferrer"&gt;Flask Datta Able&lt;/a&gt; (contains DEMO Link)&lt;/p&gt;
&lt;/blockquote&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%2F8tzf654nedy8d9vpy3kg.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%2F8tzf654nedy8d9vpy3kg.png" alt="Dynamic Table pattern in Flask/Python - Generated View with Search, Filters and Export" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's see how the dynamic programming concept applies to Dynamic Data Tables, which is the solution we're trying to achieve in this article. &lt;/p&gt;

&lt;h2&gt;
  
  
  Data Tables Pattern
&lt;/h2&gt;

&lt;p&gt;Data Tables represent a structured way of organizing and displaying data in rows and columns with built-in functionality for managing large datasets. Think of it as an enhanced table that provides:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pagination&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Breaking down large datasets into smaller, manageable pages&lt;/li&gt;
&lt;li&gt;Allows users to navigate through data without loading everything at once&lt;/li&gt;
&lt;li&gt;Typically shows X records per page (e.g., 10, 25, 50 entries)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Data Organization&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Rows represent individual records&lt;/li&gt;
&lt;li&gt;Columns represent attributes or fields&lt;/li&gt;
&lt;li&gt;Headers define the structure and can enable sorting&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Client-Side Processing&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Suitable for small datasets&lt;/li&gt;
&lt;li&gt;All records are pulled once on the client side&lt;/li&gt;
&lt;li&gt;Data is processed locally in the browser or phone application&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Server-Side processing&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Database queries fetch only the required records&lt;/li&gt;
&lt;li&gt;Reduces memory usage and improves performance&lt;/li&gt;
&lt;li&gt;Handles large datasets efficiently&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal of our research is to provide the above features out of the box using a minimal configuration and only the dynamic features of Python that can detect and manipulate data at runtime. Let's break down the task into smaller pieces and start applying the dynamic programming principles to our specific use case. &lt;/p&gt;

&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;Users should be able to activate the dynamic pattern for any model using a simple and intuitive syntax. For this, we can use a map that uses the URL as the key, and the target model as value.&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;DYNAMIC_DATATB&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;products&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;apps.models.Product&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;p&gt;The above definition will use the routing "products" to build the dynamic table for the Product Model defined in the apps/models.py&lt;/p&gt;

&lt;p&gt;The path for the model is now used to load the model class and analyze the fields and the type. &lt;/p&gt;

&lt;h2&gt;
  
  
  Loaded Model Definition
&lt;/h2&gt;

&lt;p&gt;The model can be analyzed using the &lt;strong&gt;importlib.import_module&lt;/strong&gt; and &lt;strong&gt;getattr&lt;/strong&gt; helpers as showcased below:&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;name_to_class&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;module_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;.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)[:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
        &lt;span class="n"&gt;class_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; 

        &lt;span class="n"&gt;module&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;importlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;import_module&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;module_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;getattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;class_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we call the &lt;strong&gt;name_to_class()&lt;/strong&gt; with the &lt;strong&gt;apps.models.Product&lt;/strong&gt; input, we should get the &lt;code&gt;Product Model Class&lt;/code&gt; returned by the &lt;strong&gt;getattr()&lt;/strong&gt; helper.&lt;/p&gt;

&lt;h2&gt;
  
  
  Class/Model Fields
&lt;/h2&gt;

&lt;p&gt;Having the class is the first step. Next is to get all fields, the associated types, and also all the foreign keys mapped to external types we don't know yet.   &lt;/p&gt;

&lt;p&gt;The ordinary fields can be pulled from the class definition using this code:&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;db_fields&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;aModelClass&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__table__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;columns&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;foreign_keys&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above snippet will return all fields defined using ordinary types like Integer, String, DateTime, and Text. &lt;/p&gt;

&lt;p&gt;For the Foreign key discovery, the code needs to use the model metadata that saves the distant relationships with other Models. The code that provides all associated FKs is the one below:&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;get_model_fk_values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;aModelClass&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;fk_values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt; 
    &lt;span class="n"&gt;current_table_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aModelClass&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__tablename__&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;relationship&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;aModelClass&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__mapper__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;relationships&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;relationship&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;direction&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;MANYTOONE&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;related_model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;relationship&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mapper&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;class_&lt;/span&gt;
            &lt;span class="n"&gt;foreign_key_column&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;relationship&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;local_columns&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;referenced_table_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;foreign_key_column&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;foreign_keys&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;

            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;referenced_table_name&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;current_table_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;field_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;relationship&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;
                &lt;span class="n"&gt;related_instances&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;related_model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                &lt;span class="n"&gt;fk_values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;field_name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;related_instances&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fk_values&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After solving the FKs case, the next challenge is to detect the ENUMS used by the model for mapping the information into combos. Without this detection, the ENUMS will be mapped to input fields and we might have issues during creation or update.&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;choices_dict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;aModelClass&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__table__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Enum&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;choices_dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="n"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;choice&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;enum_class&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code snippet iterates on the model fields and saves all values for each field detected as ENUM. &lt;/p&gt;

&lt;p&gt;At this point, we've achieved the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The model is automatically discovered using the URI segment and the configuration mapping&lt;/li&gt;
&lt;li&gt;Fields information (name and type) covers all cases: simple types, ENUMS, foreign keys&lt;/li&gt;
&lt;li&gt;The information is injected into the Jinja files to be presented to the user&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Dynamic Table View
&lt;/h2&gt;

&lt;p&gt;The page provided by the dynamic data table provides the usual controls like search, show hide columns control, filters and export in CSV format.&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%2F8tzf654nedy8d9vpy3kg.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%2F8tzf654nedy8d9vpy3kg.png" alt="Dynamic Table pattern in Flask/Python - Generated View with Search, Filters and Export" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The item creation page is displayed with as below:&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%2Fpq3j22gntby3p4z0z2u1.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%2Fpq3j22gntby3p4z0z2u1.png" alt="Dynamic Table pattern in Flask/Python - Item Creation Popup." width="800" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For more inputs regarding the concept feel free to contact the team in support or simply download and inspect the code in your local system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic Data Tables Sample - &lt;a href="https://app-generator.dev/product/datta-able/flask/" rel="noopener noreferrer"&gt;Flask Datta Able&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Support (Discord): &lt;a href="https://discord.gg/fZC6hup" rel="noopener noreferrer"&gt;https://discord.gg/fZC6hup&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>dynamicprogramming</category>
      <category>tables</category>
      <category>flask</category>
      <category>python</category>
    </item>
    <item>
      <title>Best NextJS Blog Starters - Please Suggest</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Wed, 05 Feb 2025 20:28:56 +0000</pubDate>
      <link>https://forem.com/sm0ke/best-nextjs-blog-starters-please-suggest-2d3m</link>
      <guid>https://forem.com/sm0ke/best-nextjs-blog-starters-please-suggest-2d3m</guid>
      <description>&lt;p&gt;Hello devs,&lt;/p&gt;

&lt;p&gt;I'm looking for a good NextJs Blog Started template, and most Vercel templates seem connected to headless content platforms like Sanity, Prismic, etc.&lt;/p&gt;

&lt;p&gt;I prefer a standalone one that translates MD/MDX, and it would be nice to be styled with Tailwind/Flowbite. &lt;/p&gt;

&lt;p&gt;Thank you! &lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>starters</category>
      <category>blogtemplates</category>
    </item>
    <item>
      <title>Build Dynamic Services using Django | VIDEO</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Tue, 15 Oct 2024 11:06:22 +0000</pubDate>
      <link>https://forem.com/sm0ke/build-dynamic-services-using-django-video-2ejh</link>
      <guid>https://forem.com/sm0ke/build-dynamic-services-using-django-video-2ejh</guid>
      <description>&lt;p&gt;Hello! This video material explains how to build dynamic services using Django, CSV Files, and &lt;a href="https://app-generator.dev/docs/developer-tools/dynamic-django/index.html" rel="noopener noreferrer"&gt;Dynamic Django&lt;/a&gt; (commercial starter). &lt;strong&gt;Thanks for watching!&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here is the video transcript.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Django&lt;/strong&gt; - general presentation&lt;/li&gt;
&lt;li&gt;Install the tool&lt;/li&gt;
&lt;li&gt;Convert &lt;a href="https://app-generator.dev/docs/developer-tools/csv-to-table.html" rel="noopener noreferrer"&gt;CSV file to a Django Model&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Migrate the Database&lt;/strong&gt; and apply changes&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://app-generator.dev/docs/developer-tools/dynamic-django/csv-loader.html" rel="noopener noreferrer"&gt;Load the information in DB&lt;/a&gt; ~= 1k rows&lt;/li&gt;
&lt;li&gt;Enable the &lt;a href="https://app-generator.dev/docs/developer-tools/dynamic-django/datatables.html" rel="noopener noreferrer"&gt;Dynamic DataTable&lt;/a&gt; module&lt;/li&gt;
&lt;li&gt;Enable the &lt;a href="https://app-generator.dev/docs/developer-tools/dynamic-django/api.html" rel="noopener noreferrer"&gt;Dynamic API&lt;/a&gt; module&lt;/li&gt;
&lt;li&gt;Present the &lt;a href="https://app-generator.dev/docs/developer-tools/dynamic-django/charts.html" rel="noopener noreferrer"&gt;Dynamic Charts&lt;/a&gt; page for the &lt;a href="https://dynamic-django.onrender.com/dynamic-charts/sales/" rel="noopener noreferrer"&gt;Sales&lt;/a&gt; Model&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/0y8qsAT7X9Q"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;The starter will be updated with more features and also the documentation will provide more insights and ways of using the Dynamic Django starter. For more resources, feel free to access:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;a href="https://app-generator.dev/" rel="noopener noreferrer"&gt;New AppSeed&lt;/a&gt; platform (open-source)&lt;/li&gt;
&lt;li&gt;Ask for support via email or &lt;a href="https://discord.gg/fZC6hup" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; (2k+ members)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>django</category>
      <category>dynamicservices</category>
    </item>
    <item>
      <title>Process big CSV Files (local or remote) in Django/Python</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Sun, 08 Sep 2024 09:13:07 +0000</pubDate>
      <link>https://forem.com/sm0ke/process-big-csv-files-local-or-remote-in-djangopython-2f3i</link>
      <guid>https://forem.com/sm0ke/process-big-csv-files-local-or-remote-in-djangopython-2f3i</guid>
      <description>&lt;p&gt;Hello coders! This article presents a tool incorporated in the &lt;a href="https://appseed.us/product/adminlte-pro/django/" rel="noopener noreferrer"&gt;Django AdminLTE&lt;/a&gt;, a premium starter crafted by AppSeed.  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here is the transcript of the video material:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Inspect the tool in the console by printing all available options&lt;/li&gt;
&lt;li&gt;Execute the tool using a distant CSV file with ~800 rows: Titanic.csv&lt;/li&gt;
&lt;li&gt;Inspect the generated code that mirrors the CSV structure: Model &amp;amp; Form&lt;/li&gt;
&lt;li&gt;Load the information from the CSV in the Database in less than 30 seconds&lt;/li&gt;
&lt;li&gt;Manage the information (search, filter, edit) using the Dynamic DataTable - module (also included in the product) &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ERlmCU3vcA0"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;For the full list of features or support feel free to access the links:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;👉 &lt;a href="https://appseed.us/product/adminlte-pro/django/" rel="noopener noreferrer"&gt;Django AdminLTE&lt;/a&gt; — official product page &lt;/li&gt;
&lt;li&gt;👉 Get &lt;a href="https://appseed.us/support/" rel="noopener noreferrer"&gt;Support&lt;/a&gt; via email &amp;amp; Discord &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>devtools</category>
      <category>django</category>
      <category>dynamic</category>
    </item>
    <item>
      <title>Generate and Deploy Django Starters | OpenSource Tool</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Tue, 03 Sep 2024 08:34:30 +0000</pubDate>
      <link>https://forem.com/sm0ke/generate-and-deploy-django-starters-opensource-tool-3h22</link>
      <guid>https://forem.com/sm0ke/generate-and-deploy-django-starters-opensource-tool-3h22</guid>
      <description>&lt;p&gt;Hello Coders! &lt;br&gt;
This video explains how to use the &lt;a href="https://app-generator.dev/tools/django-generator/" rel="noopener noreferrer"&gt;App-Generator&lt;/a&gt; platform to build our own Django Starter and later deploy it LIVE on different deployment platforms. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here is the transcript of the video material:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Short presentation of AppSeed and the new Codebase&lt;/li&gt;
&lt;li&gt;How to start AppSeed in your local workstation&lt;/li&gt;
&lt;li&gt;Generate a project template&lt;/li&gt;
&lt;li&gt;Generate a new Django starter based on selected options&lt;/li&gt;
&lt;li&gt;Upload the code to GitHub&lt;/li&gt;
&lt;li&gt;Deploy LIVE the generated code on Render&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the end, the project is deployed LIVE and we can create users and access the private pages.&lt;/p&gt;

&lt;p&gt;For support, feel free to join AppSeed and let us know how we can improve the service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app-generator.dev/" rel="noopener noreferrer"&gt;https://app-generator.dev/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/_W1zWdDVr28"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;

</description>
      <category>django</category>
      <category>opensource</category>
      <category>generator</category>
      <category>appseed</category>
    </item>
    <item>
      <title>CSV - Process Local &amp; Remote Files in Python</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Tue, 27 Aug 2024 12:07:58 +0000</pubDate>
      <link>https://forem.com/sm0ke/csv-process-local-remote-files-in-python-3b64</link>
      <guid>https://forem.com/sm0ke/csv-process-local-remote-files-in-python-3b64</guid>
      <description>&lt;p&gt;Hello coders!&lt;/p&gt;

&lt;p&gt;This article presents an &lt;strong&gt;&lt;a href="https://app-generator.dev/docs/developer-tools/csv-processor.html" rel="noopener noreferrer"&gt;open-source tool that is able to process local and remote CSV files&lt;/a&gt;&lt;/strong&gt;, load and print the information, and later map the column to Django Types. Processing CSV files is usually required when the dataset becomes large, custom reports are unsupported by Excel or full data manipulation via data tables, and API is needed. &lt;br&gt;
The current list of features can be further extended to map CSV files to database tables/models and fully generate dashboard web apps. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Source Code: &lt;a href="https://github.com/app-generator/app-generator/blob/main/cli/management/commands/tool_inspect_source.py" rel="noopener noreferrer"&gt;CSV Processor&lt;/a&gt; part of the &lt;a href="https://app-generator.dev/" rel="noopener noreferrer"&gt;AppSeed&lt;/a&gt; Service (open-source)&lt;/p&gt;
&lt;/blockquote&gt;



&lt;p&gt;Before we start explaining the code and the usage, let's summarize the tool features: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;load local and remote files &lt;/li&gt;
&lt;li&gt;print values &lt;/li&gt;
&lt;li&gt;print detected column types&lt;/li&gt;
&lt;li&gt;print the mapping types to a Django Model &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The CSV parser can be executed via the CLI after cloning the project sources and making it usable as explained in the &lt;a href="https://github.com/app-generator/app-generator" rel="noopener noreferrer"&gt;README&lt;/a&gt;. Once the installation is completed, we can call the CVS processor using this one-liner:&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="nv"&gt;$ &lt;/span&gt;python manage.py tool_inspect_source &lt;span class="nt"&gt;-f&lt;/span&gt; media/tool_inspect/csv_inspect.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The tool performs the following tasks: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;validate the input &lt;/li&gt;
&lt;li&gt;locate the CSV file (exit with error if not found)&lt;/li&gt;
&lt;li&gt;loads the information and detects the column types &lt;/li&gt;
&lt;li&gt;detects the Django column type &lt;/li&gt;
&lt;li&gt;print the first 10 rows &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same can be applied to local and remote files. For instance, we can analyze the notorious &lt;a href="https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv" rel="noopener noreferrer"&gt;Titanic.cvs&lt;/a&gt; by running this one-liner:&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="nv"&gt;$ &lt;/span&gt;python manage.py tool_inspect_source &lt;span class="nt"&gt;-f&lt;/span&gt; media/tool_inspect/csv_inspect_distant.json

&lt;span class="c"&gt;# Output&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Processing .&lt;span class="se"&gt;\m&lt;/span&gt;edia&lt;span class="se"&gt;\t&lt;/span&gt;ool_inspect&lt;span class="se"&gt;\c&lt;/span&gt;sv_inspect_distant.json
    |-- file: https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv
    |-- &lt;span class="nb"&gt;type&lt;/span&gt;: csv


Field        CSV Type    Django Types
&lt;span class="nt"&gt;-----------&lt;/span&gt;  &lt;span class="nt"&gt;----------&lt;/span&gt;  &lt;span class="nt"&gt;------------------------------------------&lt;/span&gt;
PassengerId  int64       models.IntegerField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
Survived     int64       models.IntegerField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
Pclass       int64       models.IntegerField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
Name         object      models.TextField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
Sex          object      models.TextField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
Age          float64     models.FloatField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
SibSp        int64       models.IntegerField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
Parch        int64       models.IntegerField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
Ticket       object      models.TextField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
Fare         float64     models.FloatField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
Cabin        object      models.TextField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;
Embarked     object      models.TextField&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;blank&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True, &lt;span class="nv"&gt;null&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;True&lt;span class="o"&gt;)&lt;/span&gt;


&lt;span class="o"&gt;[&lt;/span&gt;1] - PassengerId,Survived,Pclass,Name,Sex,Age,SibSp,Parch,Ticket,Fare,Cabin,Embarked
&lt;span class="o"&gt;[&lt;/span&gt;2] - 1,0,3,&lt;span class="s2"&gt;"Braund, Mr. Owen Harris"&lt;/span&gt;,male,22,1,0,A/5 21171,7.25,,S
&lt;span class="o"&gt;[&lt;/span&gt;3] - 2,1,1,&lt;span class="s2"&gt;"Cumings, Mrs. John Bradley (Florence Briggs Thayer)"&lt;/span&gt;,female,38,1,0,PC 17599,71.2833,C85,C
&lt;span class="o"&gt;[&lt;/span&gt;4] - 3,1,3,&lt;span class="s2"&gt;"Heikkinen, Miss. Laina"&lt;/span&gt;,female,26,0,0,STON/O2. 3101282,7.925,,S
&lt;span class="o"&gt;[&lt;/span&gt;5] - 4,1,1,&lt;span class="s2"&gt;"Futrelle, Mrs. Jacques Heath (Lily May Peel)"&lt;/span&gt;,female,35,1,0,113803,53.1,C123,S
&lt;span class="o"&gt;[&lt;/span&gt;6] - 5,0,3,&lt;span class="s2"&gt;"Allen, Mr. William Henry"&lt;/span&gt;,male,35,0,0,373450,8.05,,S
&lt;span class="o"&gt;[&lt;/span&gt;7] - 6,0,3,&lt;span class="s2"&gt;"Moran, Mr. James"&lt;/span&gt;,male,,0,0,330877,8.4583,,Q
&lt;span class="o"&gt;[&lt;/span&gt;8] - 7,0,1,&lt;span class="s2"&gt;"McCarthy, Mr. Timothy J"&lt;/span&gt;,male,54,0,0,17463,51.8625,E46,S
&lt;span class="o"&gt;[&lt;/span&gt;9] - 8,0,3,&lt;span class="s2"&gt;"Palsson, Master. Gosta Leonard"&lt;/span&gt;,male,2,3,1,349909,21.075,,S
&lt;span class="o"&gt;[&lt;/span&gt;10] - 9,1,3,&lt;span class="s2"&gt;"Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)"&lt;/span&gt;,female,27,0,2,347742,11.1333,,S
... &lt;span class="o"&gt;(&lt;/span&gt;truncated output&lt;span class="o"&gt;)&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Here are the relevant parts of the tool:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Loads the information&lt;/strong&gt; and prior checks the source if is local or remote&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&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;&amp;gt; Processing &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ARG_JSON&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;    |-- file: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;JSON_DATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;source&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="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;    |-- type: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;JSON_DATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;type&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="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="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;tmp_file_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; 

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;http&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;JSON_DATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;source&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
        &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;JSON_DATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;source&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;tmp_file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;h_random_ascii&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.csv&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
        &lt;span class="n"&gt;tmp_file_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;DIR_TMP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tmp_file&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;file_write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tmp_file_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;
        &lt;span class="n"&gt;JSON_DATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;source&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tmp_file_path&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;file_exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;JSON_DATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;source&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="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; &amp;gt; Err loading SOURCE: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;JSON_DATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;source&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="k"&gt;return&lt;/span&gt;

    &lt;span class="n"&gt;csv_types&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parse_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;JSON_DATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;source&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Analyze the headers&lt;/strong&gt; and map the detected types to Django Types.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For the tabular view, &lt;code&gt;Tabulate Library&lt;/code&gt; is used:&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;csv_types&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parse_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;JSON_DATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;source&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="c1"&gt;#pprint.pp ( csv_types )
&lt;/span&gt;
    &lt;span class="n"&gt;table_headers&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;Field&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;CSV Type&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 Types&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;table_rows&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;csv_types&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;t_type&lt;/span&gt;        &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;csv_types&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;t_type_django&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;django_fields&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="n"&gt;t_type&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;table_rows&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t_type_django&lt;/span&gt;&lt;span class="p"&gt;]&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="nf"&gt;tabulate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;table_rows&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;table_headers&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;The last step is to &lt;strong&gt;Print the CSV data&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="n"&gt;csv_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;load_csv_data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;JSON_DATA&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;source&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="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;csv_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;idx&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&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;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;] - &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;  

        &lt;span class="c1"&gt;# Truncate output ..
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;idx&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="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; ... (truncated output) &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; 
            &lt;span class="k"&gt;break&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, the code provides us access to the CSV information, data types, and the correspondent data types for Django. The mapping can be easily extended for any framework like Flask, Express, or NextJS. &lt;/p&gt;

&lt;p&gt;The type mapping for Django is this one:&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="c1"&gt;# Pandas Type
&lt;/span&gt;&lt;span class="n"&gt;django_fields&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;int&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;models.IntegerField(blank=True, null=True)&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;integer&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;models.IntegerField(blank=True, null=True)&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;string&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;models.TextField(blank=True, null=True)&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;string_unique&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;models.TextField(blank=True, null=False, unique=True)&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;object&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;models.TextField(blank=True, null=True)&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;object_unique&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;models.TextField(blank=True, null=False, unique=True)&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;int64&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;models.IntegerField(blank=True, null=True)&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;float64&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;models.FloatField(blank=True, null=True)&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;bool&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;models.BooleanField(null=True)&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tool is under active development and here are the next steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;connect the tool to more data sources like remote/local databases (SQLite, MySql, PgSQL), JSON &lt;/li&gt;
&lt;li&gt;Generate Models for any framework: FastAPI, Flask, Express, NextJS&lt;/li&gt;
&lt;li&gt;Generate secure APIs on top &lt;/li&gt;
&lt;li&gt;Generate server-side paginated DataTables using Tailwind/Bootstrap for styling &lt;/li&gt;
&lt;/ul&gt;




&lt;blockquote&gt;
&lt;p&gt;Thanks for reading! &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For those interested in contributing, feel free to join the new AppSeed platform and connect with the community on Discord: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://app-generator.dev/" rel="noopener noreferrer"&gt;AppSeed&lt;/a&gt; - open-source platform for developers&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://discord.gg/fZC6hup" rel="noopener noreferrer"&gt;AppSeed Community&lt;/a&gt; - 3k+ Discord members&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>csv</category>
      <category>devtools</category>
    </item>
    <item>
      <title>Django - Adding Hot Reload (with sample)</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Sun, 14 Apr 2024 09:09:42 +0000</pubDate>
      <link>https://forem.com/sm0ke/django-adding-hot-reload-with-sample-o1k</link>
      <guid>https://forem.com/sm0ke/django-adding-hot-reload-with-sample-o1k</guid>
      <description>&lt;p&gt;Hello Coders! Implementing &lt;strong&gt;hot reload for templates and static files in Django&lt;/strong&gt; can greatly improve your development workflow. You can take a few different approaches to achieve hot reload in Django, and this article presents the most simple ones. To make this article more useful, in the end, an &lt;a href="https://appseed.us/product/rocket/django/" rel="noopener noreferrer"&gt;open-source sample&lt;/a&gt; is provided. Thanks for reading!&lt;/p&gt;




&lt;h2&gt;
  
  
  1# - Watchgod Utility
&lt;/h2&gt;

&lt;p&gt;One popular method is to use the django-extensions package along with watchgod for auto-reloading.&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="nv"&gt;$ &lt;/span&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;django-extensions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, you can add django_extensions to your &lt;code&gt;INSTALLED_APPS&lt;/code&gt; in your Django settings file (&lt;code&gt;settings.py&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;For hot reloading of templates, you can use the &lt;code&gt;runserver_plus&lt;/code&gt; command provided by &lt;code&gt;django-extensions&lt;/code&gt;, which automatically reloads templates when they change.&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="nv"&gt;$ &lt;/span&gt;python manage.py runserver_plus
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For static files, you can use &lt;code&gt;watchmedo&lt;/code&gt; (a part of &lt;code&gt;watchgod&lt;/code&gt;) to monitor changes and trigger reloads:&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="nv"&gt;$ &lt;/span&gt;watchmedo shell-command &lt;span class="nt"&gt;--patterns&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"*.css;*.js;*.html"&lt;/span&gt; &lt;span class="nt"&gt;--command&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"python manage.py collectstatic --noinput"&lt;/span&gt; &lt;span class="nt"&gt;--recursive&lt;/span&gt; static
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command watches for changes in your static files directory and triggers &lt;code&gt;collectstatic&lt;/code&gt; whenever a change is detected. Combined with Django's built-in development server, this provides a pretty seamless hot reload experience for both templates and static files.&lt;/p&gt;




&lt;h2&gt;
  
  
  2# - Django-Browser-Reload
&lt;/h2&gt;

&lt;p&gt;This open-source library can be integrated with any Django project with only a few lines of code as stated on the &lt;a href="https://pypi.org/project/django-browser-reload/" rel="noopener noreferrer"&gt;official PyPi page&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Install the library using PIP or any other package manager&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;django-browser-reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure you have "&lt;strong&gt;django.contrib.staticfiles&lt;/strong&gt;" in your &lt;code&gt;INSTALLED_APPS&lt;/code&gt; section. Besides this, a new application should be added:&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;INSTALLED_APPS&lt;/span&gt; &lt;span class="o"&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;django_browser_reload&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;-- NEW
&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;p&gt;The next step is to update the project routing rules to include the library URLs:&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.urls&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;include&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;

&lt;span class="n"&gt;urlpatterns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;...,&lt;/span&gt;
    &lt;span class="nf"&gt;path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__reload__/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;include&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_browser_reload.urls&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Updating the middleware is the last configuration step required for this integration.&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;MIDDLEWARE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="c1"&gt;# ...
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;django_browser_reload.middleware.BrowserReloadMiddleware&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;# ...
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The middleware automatically inserts the required script tag on HTML responses before the &lt;strong&gt;BODY&lt;/strong&gt; tag when DEBUG is True. &lt;/p&gt;

&lt;p&gt;If all the above steps were followed, our Django project should support the HOT reload feature, and all the changes we made to the templates and static files are automatically synced with the browser.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;a href="https://appseed.us/product/rocket/django/" rel="noopener noreferrer"&gt;Free Sample with HOT Reload&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;For those in a rush for a sample, &lt;a href="https://appseed.us/product/rocket/django/" rel="noopener noreferrer"&gt;Rocket Django&lt;/a&gt;, an open-source Tailwind-based starter provides already the integration for Django-Browser-Reload Library:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;dependency added in the &lt;a href="https://github.com/app-generator/rocket-django/blob/main/requirements.txt" rel="noopener noreferrer"&gt;requirements.txt&lt;/a&gt; file&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/app-generator/rocket-django/blob/main/core/settings.py" rel="noopener noreferrer"&gt;settings&lt;/a&gt; file [ INSTALLED_APPS and MIDDLEWARE sections ]&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/app-generator/rocket-django/blob/main/core/urls.py" rel="noopener noreferrer"&gt;routing&lt;/a&gt; [ "django_browser_reload.urls" included ]&lt;/li&gt;
&lt;/ul&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%2Fzmmvy0n7hzl4ewi7u4k3.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%2Fzmmvy0n7hzl4ewi7u4k3.png" alt="Rocket Django - Open-Source Starter with Hot Reload feature" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Testing the HOT Reload
&lt;/h2&gt;

&lt;p&gt;Once we download the sources of Rocket Django from the official product page, we need to follow the usual set-up steps for every Django project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open project using VsCode or any other code editor&lt;/li&gt;
&lt;li&gt;Install dependencies&lt;/li&gt;
&lt;li&gt;Migrate database&lt;/li&gt;
&lt;li&gt;Install Tailwind dependencies and watch the CSS files using the command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npx tailwindcss &lt;span class="nt"&gt;-i&lt;/span&gt; ./static/assets/style.css &lt;span class="nt"&gt;-o&lt;/span&gt; ./static/dist/css/output.css &lt;span class="nt"&gt;--watch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Start the Django Development server
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;python manage.py runserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, all changes made on the Python files, templates [ HTML ], and assets [ CSS, JS ] are automatically reflected in the browser:&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%2Fdzovh5k23hzfxpbn9at0.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%2Fdzovh5k23hzfxpbn9at0.png" alt="Rocket Django - Sample page content updated with HOT Reload. &amp;lt;br&amp;gt;
" width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Using the right tooling (hot reload for instance) combined with a good development strategy might help us be more productive and deliver the projects with better quality.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;Thanks for reading! For more resources, feel free to access:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;👉 &lt;a href="https://appseed.us/" rel="noopener noreferrer"&gt;AppSeed&lt;/a&gt;, a platform already used by 8k registered developers&lt;/li&gt;
&lt;li&gt;👉 Read more about &lt;a href="https://blog.appseed.us/django-popular-shell-commands/" rel="noopener noreferrer"&gt;Django Popular Commands&lt;/a&gt; (a curated list)&lt;/li&gt;
&lt;li&gt;👉 Build apps with &lt;a href="https://app-generator.dev/django/" rel="noopener noreferrer"&gt;Django App Generator&lt;/a&gt; (free service)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>django</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>appseed</category>
    </item>
    <item>
      <title>Python - How "Import" Directive Works</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Tue, 09 Apr 2024 10:52:57 +0000</pubDate>
      <link>https://forem.com/sm0ke/python-how-import-directive-works-17n2</link>
      <guid>https://forem.com/sm0ke/python-how-import-directive-works-17n2</guid>
      <description>&lt;p&gt;Hello Coders! This article explains the &lt;strong&gt;&lt;a href="https://blog.appseed.us/python-how-import-directive-works/" rel="noopener noreferrer"&gt;"import" directive in Python&lt;/a&gt;&lt;/strong&gt;. How it works and how can be used in different contexts. The import directive in Python is used to bring modules or packages into your current namespace, allowing you to use the functionality defined within them. Thanks for reading!&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;Let's break down how it works in detail:&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ✅ Basic Importing
&lt;/h2&gt;

&lt;p&gt;You can import a module or package in Python using the import keyword followed by the name of the module or package:&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;import&lt;/span&gt; &lt;span class="n"&gt;module_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OR&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;import&lt;/span&gt; &lt;span class="n"&gt;package_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✅ Using Imported Items
&lt;/h2&gt;

&lt;p&gt;Once imported, you can use functions, classes, or variables defined in the module or package by prefixing them with the module or package name:&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;module_name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;function_name&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OR&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;package_name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;module_name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;function_name&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✅ Importing Specific Items
&lt;/h2&gt;

&lt;p&gt;You can import specific items from a module instead of the entire module using the &lt;code&gt;from&lt;/code&gt; keyword:&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;module_name&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;function_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also import multiple items from a module using comma separation:&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;module_name&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;function_name1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;function_name2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✅ Aliasing
&lt;/h2&gt;

&lt;p&gt;You can provide an alias to imported modules or items using the &lt;code&gt;as&lt;/code&gt; keyword:&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;import&lt;/span&gt; &lt;span class="n"&gt;module_name&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;alias_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OR&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;module_name&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;function_name&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;alias_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✅ Importing All Items
&lt;/h2&gt;

&lt;p&gt;You can import all items from a module using the &lt;code&gt;*&lt;/code&gt; wildcard:&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;module_name&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, it's generally not recommended because it can lead to namespace pollution and makes it unclear where each item is coming from, and also imports items unused in the current context.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Importing Packages
&lt;/h2&gt;

&lt;p&gt;If you want to import a module from a package, you use dot notation:&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;import&lt;/span&gt; &lt;span class="n"&gt;package_name.module_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OR&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;package_name&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;module_name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✅ Execution of Import Statements
&lt;/h2&gt;

&lt;p&gt;Import statements are executed just like any other statements, and they are typically executed only once per interpreter session. After a module is imported, it's cached in &lt;code&gt;sys.modules&lt;/code&gt;, so subsequent imports of the same module do not cause it to be re-executed.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Conclusion
&lt;/h2&gt;

&lt;p&gt;In summary, the import directive in Python is a powerful tool for bringing in functionality from modules and packages. It allows you to organize your code into reusable and modular components, making it easier to manage and maintain large codebases. Understanding how to use import effectively is essential for writing clean and maintainable Python code.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Thanks for reading!&lt;/strong&gt; For more resources, feel free to access:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;👉 &lt;a href="https://appseed.us/" rel="noopener noreferrer"&gt;AppSeed&lt;/a&gt;, a platform already used by 8k registered developers&lt;/li&gt;
&lt;li&gt;👉 Build apps with &lt;a href="https://app-generator.dev/django/" rel="noopener noreferrer"&gt;Django App Generator&lt;/a&gt; (free service) &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>debugging</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Simple Tailwind &amp; Stripe eCommerce</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Mon, 01 Apr 2024 16:50:44 +0000</pubDate>
      <link>https://forem.com/sm0ke/simple-tailwind-stripe-ecommerce-1e47</link>
      <guid>https://forem.com/sm0ke/simple-tailwind-stripe-ecommerce-1e47</guid>
      <description>&lt;p&gt;Hello Coders! This article presents &lt;a href="https://appseed.us/product/rocket-ecommerce/django/" rel="noopener noreferrer"&gt;Rocket eCommerce&lt;/a&gt;, a simple yet powerful CMS Starter, that aims to help small businesses sell physical and digital products online with minimal effort and costs using &lt;strong&gt;Stripe&lt;/strong&gt; as the payment processor and &lt;strong&gt;Tailwind&lt;/strong&gt; for styling.&lt;/p&gt;

&lt;p&gt;👉 LIVE Demo: &lt;a href="https://rocket-ecommerce.onrender.com" rel="noopener noreferrer"&gt;Rocket eCommerce&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTE: The &lt;a href="https://github.com/app-generator/rocket-ecommerce" rel="noopener noreferrer"&gt;source code&lt;/a&gt; can be downloaded from GitHub (public repository) for those interested in &lt;code&gt;trying the product before buying&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;The advantages of using this product compared with the classic ones like Shopify, WooCommerce or Medusa are simplicity, low costs, and the possibility to extend the core features via a custom development effort that any developer can do.&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%2Fqo6clqsawrnalipf8vd4.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%2Fqo6clqsawrnalipf8vd4.png" alt="Rocket eCommerce - the HOMEpage." width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/app-generator/rocket-ecommerce" rel="noopener noreferrer"&gt;source code&lt;/a&gt; (published on GitHub) needs to be connected to the Stripe Service via the API keys and the first step is to import the products using the ADMIN account:&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%2Fklgks5t3jsdorpp63y1w.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%2Fklgks5t3jsdorpp63y1w.png" alt="Rocket eCommerce - Stripe Products Import" width="800" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each Stripe product can be mapped to a local product and published on the website by adding local properties, more images, a complete description, and tags.&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%2Ftaonit9us957ry0u6ysc.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%2Ftaonit9us957ry0u6ysc.png" alt="Rocket eCommerce - Edit Local Product " width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Besides the &lt;strong&gt;MAIN image pulled from Stripe&lt;/strong&gt;, the user can upload other 5 images and also edit each one using a simple image editor:&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%2F2ibfd7jqc9hs8e16aj5d.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%2F2ibfd7jqc9hs8e16aj5d.png" alt="Rocket eCommerce - Crop, edit Images" width="800" height="871"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;The ADMIN is also able to manage all users and reset their passwords using a simple UI as shown below:&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%2Fb0v47mm410j0bqasat9u.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%2Fb0v47mm410j0bqasat9u.png" alt="Rocket eCommerce - ADMIN, edit users." width="800" height="222"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Site Settings
&lt;/h2&gt;

&lt;p&gt;Being ADMIN, you can also customize other things like site name, and copyright, both visible in the page titles and footer.&lt;/p&gt;

&lt;p&gt;The social links (Facebook, Instagram, and Twitter) once edited, are visible in the website footer: &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%2F06ni3z7g08qmgqpy9xmr.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%2F06ni3z7g08qmgqpy9xmr.png" alt="Rocket eCommerce - ADMIN, site Settings" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The effect of these settings is visible in the service footer:&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%2Fuoh87emm820bfneolr7w.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%2Fuoh87emm820bfneolr7w.png" alt="Rocket eCommerce - ADMIN, social links." width="800" height="81"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;The content pages like &lt;a href="https://rocket-ecommerce.onrender.com/terms/" rel="noopener noreferrer"&gt;Terms &amp;amp; Conditions&lt;/a&gt;, &lt;a href="https://rocket-ecommerce.onrender.com/privacy/" rel="noopener noreferrer"&gt;Privacy&lt;/a&gt;, and &lt;strong&gt;Help&lt;/strong&gt; are editable using a visual HTML editor:&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%2Fnig8luspb4j2wsn58jhi.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%2Fnig8luspb4j2wsn58jhi.png" alt="Rocket eCommerce - ADMIN, edit content pages." width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Product Screens
&lt;/h2&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%2Fr9yvhqyun92p5u5jttd6.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%2Fr9yvhqyun92p5u5jttd6.png" alt="Rocket eCommerce - Product Page." width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;Rocket eCommerce - &lt;a href="https://rocket-ecommerce.onrender.com/search/" rel="noopener noreferrer"&gt;Search&lt;/a&gt; Page&lt;/p&gt;
&lt;/blockquote&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%2Fur8r9i4frb92tq15u4j0.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%2Fur8r9i4frb92tq15u4j0.png" alt="Rocket eCommerce - Search Page." width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;Rocket eCommerce - &lt;a href="https://rocket-ecommerce.onrender.com/cart/" rel="noopener noreferrer"&gt;Checkout&lt;/a&gt; Page &lt;/p&gt;
&lt;/blockquote&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%2Flmfn63dgragteaexfbcm.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%2Flmfn63dgragteaexfbcm.png" alt="Rocket eCommerce - Search Page" width="800" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The payment flow can be tested by using a Stripe Test Card information &lt;strong&gt;4242 4242 4242 4242&lt;/strong&gt; as shown below.&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%2Ff1yg9l2sesqggzc1775v.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%2Ff1yg9l2sesqggzc1775v.png" alt="Rocket eCommerce - Payment Page (powered by Stripe)" width="800" height="623"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;The product is continuously updated based on the user's feedback and issues reported on GitHub.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Thanks for reading&lt;/code&gt;! For more starters and support, feel free to access:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;👉 Access &lt;a href="https://appseed.us/" rel="noopener noreferrer"&gt;AppSeed&lt;/a&gt; for more starters and support&lt;/li&gt;
&lt;li&gt;👉 Build apps with &lt;a href="https://app-generator.dev/django/" rel="noopener noreferrer"&gt;Django App Generator&lt;/a&gt; (free service) &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ecommerce</category>
      <category>stripe</category>
      <category>django</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Managing the UI in Django</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Mon, 09 Oct 2023 14:00:00 +0000</pubDate>
      <link>https://forem.com/sm0ke/managing-the-ui-in-django-4pf0</link>
      <guid>https://forem.com/sm0ke/managing-the-ui-in-django-4pf0</guid>
      <description>&lt;p&gt;Hello Coders!&lt;/p&gt;

&lt;p&gt;This article explains &lt;a href="https://blog.appseed.us/managing-the-ui-in-django/" rel="noopener noreferrer"&gt;How to integrate a new UI into a Django project&lt;/a&gt; (new or legacy). As we all know already, the UI is an important part of any project, being the only layer visible to the users. Here are a few solutions to successfully code the UI for a Django project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Use a components library and code the UI from scratch&lt;/li&gt;
&lt;li&gt;✅ Use existing HTML Design, process the pages and the static assets&lt;/li&gt;
&lt;li&gt;✅ Use an existing UI library styled with a design closer to the product's visual identity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's say a few words for each option.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ #1 - Components library
&lt;/h2&gt;

&lt;p&gt;This approach might be the best in the long run but requires design and Javascript, two skills that sometimes are not so great for backend developers.&lt;/p&gt;

&lt;p&gt;The integration of a component library can be done using a minimal tooling integration that usually involves NodeJS and Webpack.&lt;/p&gt;

&lt;p&gt;Here are a few Tailwind Component libraries that provide integration guides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;👉 &lt;a href="https://flowbite.com/docs/getting-started/django/" rel="noopener noreferrer"&gt;Tailwind CSS Django - Flowbite&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;👉 &lt;a href="https://tailwind-elements.com/docs/standard/integrations/django-integration/" rel="noopener noreferrer"&gt;Tailwind Elements Django integration&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;A fully integrated &lt;strong&gt;Django &amp;amp; Tailwind&lt;/strong&gt; Sample can be found on GitHub along with other features like a dashboard layout, Celery Integration, and Docker support.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉 &lt;a href="https://github.com/app-generator/rocket-django" rel="noopener noreferrer"&gt;Rocket Django&lt;/a&gt; - open-source starter&lt;/p&gt;
&lt;/blockquote&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%2F46bma73omk1lsla6rxpo.gif" 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%2F46bma73omk1lsla6rxpo.gif" alt="Tailwind UI integration in Django - Free Sample." width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ #2 - Use an Existing Design
&lt;/h2&gt;

&lt;p&gt;This solution also might be a good solution but requires processing the pages, extracting the components, isolating the assets, and later ressemble all in Django.&lt;/p&gt;

&lt;p&gt;For those with time and knowledge, here are some really nice and actively supported kits styled with Bootstrap and Tailwind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;👉 &lt;a href="https://www.creative-tim.com/product/material-kit?AFFILIATE=128200" rel="noopener noreferrer"&gt;Material Kit Bootstrap 5&lt;/a&gt; - open-source design
&lt;/li&gt;
&lt;li&gt;👉 &lt;a href="https://www.creative-tim.com/product/material-dashboard?AFFILIATE=128200" rel="noopener noreferrer"&gt;Material Dashboard&lt;/a&gt; - free Bootstrap 5 Design&lt;/li&gt;
&lt;li&gt;👉 &lt;a href="https://adminmart.com/product/modernize-free-bootstrap-5-admin-template/?ref=1" rel="noopener noreferrer"&gt;Modernize&lt;/a&gt;, a really nice design from AdminMart&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the sources are downloaded, the developer needs to extract the components, build the master pages, and process the assets path using the "static" tag. This Operation might be time-costly but once finished, the design can be used for multiple projects in the long run.&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%2Fwmsbtgm21ichgh0biijg.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%2Fwmsbtgm21ichgh0biijg.png" alt="Material Dashboard - Modern UI for Django " width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ #3 - Using UI Libraries
&lt;/h2&gt;

&lt;p&gt;This section will mention a few Django UI libraries usable via PIP and a minimal configuration effort. Here are the benefits of this solution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The UI is already compatible with Django&lt;/li&gt;
&lt;li&gt;Easy access to the updates&lt;/li&gt;
&lt;li&gt;Some of them provide also the style for the ADMIN section reserved for superusers&lt;/li&gt;
&lt;li&gt;The support, in case of any issues, is there&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's start with a popular sample built in Bootstrap 5: &lt;a href="https://github.com/app-generator/django-admin-volt" rel="noopener noreferrer"&gt;Volt Dashboard&lt;/a&gt;. The library sources are saved on GitHub and the installation steps are explained in the &lt;a href="https://github.com/app-generator/django-admin-volt/blob/main/README.md" rel="noopener noreferrer"&gt;README&lt;/a&gt; file.&lt;/p&gt;

&lt;p&gt;The first step is to install the library via PIP or any other package manager:&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="nv"&gt;$ &lt;/span&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;django-admin-volt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Django configuration needs to be updated, especially the &lt;code&gt;INSTALLED_APPS&lt;/code&gt; section as shown below.&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;INSTALLED_APPS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="bp"&gt;...&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;admin_volt.apps.AdminVoltConfig&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# &amp;lt;-- NEW
&lt;/span&gt;        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;django.contrib.admin&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All &lt;a href="https://github.com/app-generator/django-admin-volt/blob/main/admin_volt/urls.py?ref=blog.appseed.us" rel="noopener noreferrer"&gt;the routes provided by the library&lt;/a&gt; need also to be integrated into the core project routing, as shown below.&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.urls&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;include&lt;/span&gt;

    &lt;span class="n"&gt;urlpatterns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="bp"&gt;...&lt;/span&gt;
        &lt;span class="nf"&gt;path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;include&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_volt.urls&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With all the above changes made, our project should be already styled with VOLT Dashboard Design (admin section included).&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%2Fo8xwlih63atb2rjp74s0.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%2Fo8xwlih63atb2rjp74s0.png" alt="Volt Dashboard - UI Library for Django" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;With the design properly integrated, the developer might want to customize the pages and this can be easily done by using a local template and static directory where the default UI Library pages and assets are overwritten.&lt;/p&gt;

&lt;p&gt;Django assists very well on this by searching the pages and the assets using this order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Local scope, inside the current app&lt;/li&gt;
&lt;li&gt;Project global scope, usually the root of the project&lt;/li&gt;
&lt;li&gt;Virtual Environment, for assets and pages provided by the Library&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If we decide at some point to customize the pages or an asset (CSS, image), all we need is to create a local version that respects the same path as provided in the library.&lt;/p&gt;

&lt;p&gt;For instance, if we analyze the codebase of &lt;a href="https://github.com/app-generator/django-admin-volt/tree/main/admin_volt?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Volt UI Library&lt;/a&gt;, we should see this structure:&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="c"&gt;# This exists in ENV: LIB/admin_volt&lt;/span&gt;
&amp;lt; UI_LIBRARY_ROOT &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;                     
   |
   |-- templates/                    &lt;span class="c"&gt;# Root Templates Folder &lt;/span&gt;
   |    |          
   |    |-- accounts/       
   |    |    |-- sign-in.html        &lt;span class="c"&gt;# Sign IN Page&lt;/span&gt;
   |    |    |-- sign-up.html        &lt;span class="c"&gt;# Sign UP Page&lt;/span&gt;
   |    |
   |    |-- includes/       
   |    |    |-- footer.html         &lt;span class="c"&gt;# Footer component&lt;/span&gt;
   |    |    |-- sidebar.html        &lt;span class="c"&gt;# Sidebar component&lt;/span&gt;
   |    |    |-- navigation.html     &lt;span class="c"&gt;# Navigation Bar&lt;/span&gt;
   |    |    |-- scripts.html        &lt;span class="c"&gt;# Scripts Component&lt;/span&gt;
   |    |
   |    |-- layouts/       
   |    |    |-- base.html           &lt;span class="c"&gt;# Masterpage&lt;/span&gt;
   |    |    |-- base-auth.html      &lt;span class="c"&gt;# Masterpage for Auth Pages&lt;/span&gt;
   |    |
   |    |-- pages/       
   |         |-- index.html          &lt;span class="c"&gt;# Index Page (presentation)&lt;/span&gt;
   |         |-- settings.html       &lt;span class="c"&gt;# Settings  Page&lt;/span&gt;
   |         |-- dashboard.html      &lt;span class="c"&gt;# Dashboard page&lt;/span&gt;
   |         |-- &lt;span class="k"&gt;*&lt;/span&gt;.html              &lt;span class="c"&gt;# All other pages&lt;/span&gt;
   |    
   |-- &lt;span class="k"&gt;******************************&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the project requires customization, we need to copy the original file that needs an update (from the virtual environment) and place it in the template folder using the same path.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For instance, if we want to &lt;strong&gt;customize the footer.html&lt;/strong&gt; these are the steps:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Step 1: Create the templates DIRECTORY inside the home app&lt;/li&gt;
&lt;li&gt;Step 2: Configure the project to use this new template directory
core/settings.py TEMPLATES section&lt;/li&gt;
&lt;li&gt;Step 3: Copy the footer.html from the original location (inside your ENV) and save it to the home/templates DIR&lt;/li&gt;
&lt;li&gt;Source PATH: /LIB/admin_volt/includes/footer.html&lt;/li&gt;
&lt;li&gt;Destination PATH: home/templates/includes/footer.html&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To speed up all these steps, &lt;a href="https://github.com/app-generator/django-volt-dashboard?ref=blog.appseed.us" rel="noopener noreferrer"&gt;this sample codebase&lt;/a&gt; is already configured (&lt;code&gt;Steps 1, and 2&lt;/code&gt;), and a &lt;code&gt;custom footer&lt;/code&gt; can be found at &lt;a href="https://github.com/app-generator/django-volt-dashboard/tree/master/home/templates/includes?ref=blog.appseed.us" rel="noopener noreferrer"&gt;this&lt;/a&gt; location:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;home/templates/includes/custom_footer.html&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;By default, this file is unused because the &lt;code&gt;theme&lt;/code&gt; expects &lt;code&gt;footer.html&lt;/code&gt; (without the &lt;code&gt;custom-&lt;/code&gt; prefix).&lt;/p&gt;

&lt;p&gt;In order to use it, simply rename it to footer.html. Like this, the default version shipped in the library is ignored by Django.&lt;/p&gt;

&lt;p&gt;In a similar way, all other files and components can be customized easily.&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%2Fpld1ywk6y41zimrcb5tv.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%2Fpld1ywk6y41zimrcb5tv.png" alt="User Profile Page - Volt Django UI Library" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ More Django UI LIBs
&lt;/h2&gt;

&lt;p&gt;Volt UI Library is just one of many open-source libraries we can use for free in our Django projects. Here are UI libraries actively supported and versioned:&lt;/p&gt;

&lt;h3&gt;
  
  
  👉 &lt;a href="https://github.com/app-generator/django-admin-soft-dashboard?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Django Soft UI Library&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This UI library uses Soft UI Dashboard, an open-source Bootstrap 5 design from Creative-Tim.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://django-soft-dash.onrender.com/?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Django Soft Dashboard&lt;/a&gt; - LIVE Demo&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://appseed.us/product/soft-ui-dashboard/django/?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Django Soft Dashboard&lt;/a&gt; - the product that uses the UI&lt;/li&gt;
&lt;/ul&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%2Fotwggw9vtavrrek7v4sj.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%2Fotwggw9vtavrrek7v4sj.png" alt="Soft Dashboard - UI Library for Django" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  👉 &lt;a href="https://github.com/app-generator/django-theme-material-kit?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Django UI Material Kit&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This Freebie Bootstrap 5 Design System comes with prebuilt design blocks, so the development process is seamless, switching from our pages to the real website is very easy to be done.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://django-material-kit.appseed-srv1.com/?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Django Material Kit&lt;/a&gt; - LIVE Demo&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://appseed.us/product/material-kit/django/?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Django Material Kit&lt;/a&gt; -  the product that uses the UI&lt;/li&gt;
&lt;/ul&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%2F1qcx6sampv7a2lgh98as.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%2F1qcx6sampv7a2lgh98as.png" alt="Material Kit - UI Library for Django" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  👉 &lt;a href="https://github.com/app-generator/django-admin-modernize" rel="noopener noreferrer"&gt;Django UI Modernize&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;UI Library that integrates Modernize, an open-source Bootstrap 5 design from &lt;a href="https://adminmart.com/?ref=1" rel="noopener noreferrer"&gt;AdminMart&lt;/a&gt;. The product is designed to deliver the best possible user experience with highly customizable feature-rich pages. Modernize has an easy and intuitive responsive design whether it is viewed on retina screens or laptops.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://django-modernize.onrender.com/?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Django Modernize&lt;/a&gt; - LIVE Demo&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://appseed.us/product/modernize-dashboard/django/?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Django Modernize&lt;/a&gt; -  the product that uses the UI&lt;/li&gt;
&lt;/ul&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%2F2nmos0xozac7vfgy91rr.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%2F2nmos0xozac7vfgy91rr.png" alt="Modernize BS5 - UI Library for Django" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ In Summary
&lt;/h2&gt;

&lt;p&gt;Styling a Django APP or a project is not an easy decision for sure, but these days we have plenty of options starting from free and open-source libraries up to PAID and corporate-grade designs with more components, pages, and fast support.&lt;/p&gt;

&lt;p&gt;For more resources, feel free to access:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;👉 Access &lt;a href="https://appseed.us/?ref=blog.appseed.us" rel="noopener noreferrer"&gt;AppSeed&lt;/a&gt; for more starters and support&lt;/li&gt;
&lt;li&gt;👉 &lt;a href="https://www.docs.deploypro.dev/?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Deploy Projects on Aws, Azure, and DO&lt;/a&gt; via DeployPRO&lt;/li&gt;
&lt;li&gt;👉 Create landing pages with &lt;a href="https://www.simpllo.com/?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Simpllo, an open-source site builder&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;👉 Build apps with &lt;a href="https://app-generator.dev/django/?ref=blog.appseed.us" rel="noopener noreferrer"&gt;Django App Generator&lt;/a&gt; (free service)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>django</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Tailwind &amp; Django - Free Starter</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Wed, 04 Oct 2023 08:53:44 +0000</pubDate>
      <link>https://forem.com/sm0ke/tailwind-django-free-starter-1209</link>
      <guid>https://forem.com/sm0ke/tailwind-django-free-starter-1209</guid>
      <description>&lt;p&gt;Hello Coders!&lt;/p&gt;

&lt;p&gt;This article presents an open-source &lt;a href="https://github.com/app-generator/rocket-django" rel="noopener noreferrer"&gt;Tailwind &amp;amp; Django&lt;/a&gt; project styled with &lt;code&gt;Flowbite&lt;/code&gt;, a popular UI Library built on top of &lt;strong&gt;Tailwind&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://rocket-django.onrender.com/" rel="noopener noreferrer"&gt;Rocket Django &lt;/a&gt; provides a minimal codebase, Tailwind-compatible tooling, Docker, and CI/CD support for Render. The product can be used to bootstrap any type of product on top of &lt;code&gt;Django &amp;amp; Tailwind&lt;/code&gt;, two popular technologies for the modern web.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;👉 &lt;a href="https://rocket-django.onrender.com/" rel="noopener noreferrer"&gt;Tailwind &amp;amp; Django Starter&lt;/a&gt; - &lt;code&gt;LIVE Demo&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;👉 &lt;a href="https://github.com/app-generator/rocket-django" rel="noopener noreferrer"&gt;Tailwind &amp;amp; Django Starter&lt;/a&gt; - &lt;code&gt;Source Code&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;The product can be used in a local environment if NodeJs, Python, and (optionally) Docker are already present and properly configured.&lt;/p&gt;

&lt;p&gt;For those interested in compiling the product, here are the steps (manual setup):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;✅ Clone/Download the sources&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git clone https://github.com/app-generator/rocket-django.git
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;rocket-django
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;✅  Install Dependencies&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;virtualenv &lt;span class="nb"&gt;env&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;source env&lt;/span&gt;/bin/activate
&lt;span class="nv"&gt;$ &lt;/span&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;✅ Install Tailwind/Flowbite (another terminal)&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;static
&lt;span class="nv"&gt;$ &lt;/span&gt;yarn  
&lt;span class="nv"&gt;$ &lt;/span&gt;npx tailwindcss &lt;span class="nt"&gt;-i&lt;/span&gt; ./src/input.css &lt;span class="nt"&gt;-o&lt;/span&gt; ./dist/css/output.css &lt;span class="nt"&gt;--watch&lt;/span&gt;   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;✅ Migrate Database&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;✅ Start the Django &amp;amp; Tailwind App&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;python manage.py createsuperuser &lt;span class="c"&gt;# create the admin&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;python manage.py runserver       &lt;span class="c"&gt;# start the project&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, we should see the dashboard view provided by the Flowbite dashboard. &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%2Fhpnq294i5btng770fltn.gif" 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%2Fhpnq294i5btng770fltn.gif" alt="Tailwind &amp;amp; Django - Main Dashboard (Desktop &amp;amp; Mobile)" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Another way to start the product is to use the Docker Compose Script shipped with the sources. By navigating to the root of the source code, this is what we need to type in the terminal:&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="nv"&gt;$ &lt;/span&gt;docker-compose up &lt;span class="nt"&gt;--build&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Docker execution, the app starts on &lt;code&gt;localhost:5085&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This simple starter also provides a &lt;a href="https://rocket-django.onrender.com/starter/" rel="noopener noreferrer"&gt;starter page&lt;/a&gt; with a responsive navigation bar and a hero section.&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%2F8evs6w6wm32psbqai5rz.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%2F8evs6w6wm32psbqai5rz.png" alt="Tailwind &amp;amp; Django - The Starter Page (Flowbite Components)" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Resources
&lt;/h2&gt;

&lt;p&gt;For more resources and support, follow up on the links &amp;amp; information presented in the following section.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;👉 Access &lt;a href="https://appseed.us/" rel="noopener noreferrer"&gt;AppSeed&lt;/a&gt; for support and starters
&lt;/li&gt;
&lt;li&gt;👉 Free &lt;a href="https://app-generator.dev/django/" rel="noopener noreferrer"&gt;Django App Generator&lt;/a&gt; - A 2nd generation App Builder&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ✅ &lt;a href="https://docs.appseed.us/content/what-is/tailwind-css/" rel="noopener noreferrer"&gt;What is Tailwind&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Tailwind CSS&lt;/strong&gt; is a popular utility-first CSS framework used for building responsive and customizable web interfaces. It provides a set of pre-designed utility classes that you can apply directly to HTML elements to style and layout your web pages.&lt;/p&gt;

&lt;p&gt;Tailwind CSS is known for its simplicity and flexibility, allowing developers to rapidly create modern and visually appealing user interfaces.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Utility-First ​&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Tailwind CSS promotes a utility-first approach to styling, where you apply classes directly to HTML elements to define styles. These classes provide a wide range of styling options, such as colors, typography, spacing, and flexbox-based layouts.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Component-Oriented​&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Tailwind CSS can be used in conjunction with component-based frameworks or libraries like Vue.js or React. You can build reusable UI components and apply Tailwind classes to style them.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Plugins​&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Tailwind CSS supports plugins that add additional utility classes or functionality. This allows you to tailor the framework to your project's needs and integrate third-party plugins as well.&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%2Fut5ki6voh852v2xcn5xo.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%2Fut5ki6voh852v2xcn5xo.png" alt="What is Tailwind - A popular CSS Framework" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  ✅ &lt;a href="https://docs.appseed.us/content/what-is/django/" rel="noopener noreferrer"&gt;What is Django&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Django&lt;/strong&gt; is a high-level, open-source web framework written in Python that enables developers to build web applications quickly and with a clean, pragmatic design.  &lt;/p&gt;

&lt;p&gt;It follows the "batteries-included" philosophy, providing a comprehensive set of tools and libraries that simplify common web development tasks, such as handling databases, managing user authentication, and generating HTML templates.  &lt;/p&gt;

&lt;p&gt;Django can be used to code simple websites, CMS (content management system), eCommerce Platforms, APIs, or as an interface to ML/AI systems.&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%2F0c9atoscmlk738xyw5hx.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%2F0c9atoscmlk738xyw5hx.png" alt="What is Django - A leading Backend Framework crafted in Python" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tailwindcss</category>
      <category>django</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Django 5 Release - Highlights &amp; Free Sample</title>
      <dc:creator>Sm0ke</dc:creator>
      <pubDate>Sun, 01 Oct 2023 13:31:45 +0000</pubDate>
      <link>https://forem.com/sm0ke/django-50-release-highlights-free-sample-81c</link>
      <guid>https://forem.com/sm0ke/django-50-release-highlights-free-sample-81c</guid>
      <description>&lt;p&gt;Hello Coders!&lt;/p&gt;

&lt;p&gt;As &lt;a href="https://www.djangoproject.com/weblog/2023/sep/18/django-50-alpha-1-released/" rel="noopener noreferrer"&gt;announced&lt;/a&gt; on the official &lt;strong&gt;Django&lt;/strong&gt; site, the &lt;strong&gt;Django 5.0&lt;/strong&gt; Version is out. The changes provided in this version are listed below.  &lt;/p&gt;

&lt;p&gt;Curious minds and cutting-edge developers can test the new features by using the latest Django 5.x release:&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="nv"&gt;$ &lt;/span&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;&lt;span class="nv"&gt;Django&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;5.0a1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to make this article more useful, here is an open-source Django Starter already updated to use &lt;code&gt;django==5.0a1&lt;/code&gt; version and deployed on Render via a CI/CD flow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;👉 &lt;a href="https://github.com/app-generator/django-v5-datta-able" rel="noopener noreferrer"&gt;Django v5.x Datta Able&lt;/a&gt; - &lt;code&gt;Source Code&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;👉 &lt;a href="https://django-v5-datta.onrender.com/" rel="noopener noreferrer"&gt;Django v5.x Datta Able&lt;/a&gt; - &lt;code&gt;LIVE Demo&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&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%2Fyd9jth7qqm753sgamw52.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%2Fyd9jth7qqm753sgamw52.png" alt="Django v5.x Datta Able - Free Starter updated to Django 5.x Version" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;✅ Python Compatibility  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Django 5.x&lt;/strong&gt; supports Python 3.10, 3.11, and &lt;strong&gt;3.12&lt;/strong&gt;. Please note the 4.2.x versions are the last to support Python 3.8 and 3.9.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;✅ Facet filters in the admin&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://docs.djangoproject.com/en/dev/ref/contrib/admin/filters/?ref=blog.appseed.us#facet-filters" rel="noopener noreferrer"&gt;Facet&lt;/a&gt; counts are now shown for applied filters in the admin change list when toggled on via the UI. This behavior can be changed via the new &lt;a href="https://docs.djangoproject.com/en/dev/ref/contrib/admin/?ref=blog.appseed.us#django.contrib.admin.ModelAdmin.show_facets" rel="noopener noreferrer"&gt;ModelAdmin.show_facets&lt;/a&gt; attribute.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;✅ Simplified templates for form field rendering&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Django 5.x&lt;/strong&gt; introduces &lt;a href="https://docs.djangoproject.com/en/dev/topics/forms/?ref=blog.appseed.us#reusable-field-group-templates" rel="noopener noreferrer"&gt;two new concepts that simplify the rendering&lt;/a&gt; of the related elements of a Django form field such as its label, widget, help text, and errors.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"field group"&lt;/li&gt;
&lt;li&gt;"field group templates"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Here is the official coding sample&lt;/strong&gt;, provided by the RN:&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="bp"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;as_field_group&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;row&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;as_field_group&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;col&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;as_field_group&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="bp"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;✅ Database-computed default values&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The new field added, &lt;a href="https://docs.djangoproject.com/en/dev/ref/models/fields/?ref=blog.appseed.us#django.db.models.Field.db_default" rel="noopener noreferrer"&gt;Field.db_default&lt;/a&gt;, parameter sets a database-computed default value. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the official coding sample&lt;/strong&gt;:&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="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;django.db.models.functions&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Pi&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyModel&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;age&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;IntegerField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;db_default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;created&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;DateTimeField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;db_default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;circumference&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;FloatField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;db_default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nc"&gt;Pi&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;✅ Database generated model field&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The new &lt;a href="https://docs.djangoproject.com/en/dev/ref/models/fields/?ref=blog.appseed.us#django.db.models.GeneratedField" rel="noopener noreferrer"&gt;GeneratedField&lt;/a&gt; allows the creation of database-generated columns. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the official coding sample&lt;/strong&gt;:&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="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;django.db.models&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;F&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Square&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;side&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;IntegerField&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;area&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;GeneratedField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expression&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;F&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;side&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nc"&gt;F&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;side&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;db_persist&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;✅ Options for declaring field choices&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://docs.djangoproject.com/en/dev/ref/models/fields/?ref=blog.appseed.us#django.db.models.Field.choices" rel="noopener noreferrer"&gt;Field.choices&lt;/a&gt; (for model fields) and &lt;a href="https://docs.djangoproject.com/en/dev/ref/forms/fields/?ref=blog.appseed.us#django.forms.ChoiceField.choices" rel="noopener noreferrer"&gt;ChoiceField.choices&lt;/a&gt; (for form fields) allow for more flexibility when declaring their values. In previous versions of Django, choices should either be a list of 2-tuples, or an Enumeration types subclass, but the latter required accessing the .choices attribute to provide the values in the expected form&lt;/p&gt;

&lt;p&gt;Django 5.0 adds support for accepting a mapping or a callable instead of an iterable, and also no longer requires .choices to be used directly to expand &lt;a href="https://docs.djangoproject.com/en/dev/ref/models/fields/?ref=blog.appseed.us#field-choices-enum-types" rel="noopener noreferrer"&gt;enumeration types&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the official coding sample&lt;/strong&gt;:&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="n"&gt;Medal&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;TextChoices&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Medal&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;GOLD SILVER BRONZE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;SPORT_CHOICES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  &lt;span class="c1"&gt;# Using a mapping instead of a list of 2-tuples.
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Martial Arts&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;judo&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;Judo&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;karate&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;Karate&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;Racket&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;badminton&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;Badminton&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;tennis&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;Tennis&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;unknown&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;Unknown&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_scores&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Winner&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;medal&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;choices&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Medal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Using `.choices` not required.
&lt;/span&gt;    &lt;span class="n"&gt;sport&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;choices&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;SPORT_CHOICES&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;score&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;IntegerField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;get_scores&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# A callable is allowed.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;✅ Other minor changes&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;django.contrib.admin&lt;/strong&gt; - jQuery is upgraded to 3.7.1.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;django.contrib.auth&lt;/strong&gt; - The new asynchronous functions are now provided, using an a prefix: django.contrib.auth.aauthenticate(), aget_user(), alogin(), alogout(), and aupdate_session_auth_hash().&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asynchronous views&lt;/strong&gt; - Under ASGI, http.disconnect events are now handled. This allows views to perform any necessary cleanup if a client disconnects before the response is generated.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✅ In Summary
&lt;/h2&gt;

&lt;p&gt;Django is a high-level Python web framework that simplifies and accelerates web development by providing a robust set of tools, libraries, and conventions. It emphasizes rapid development, clean and pragmatic design, and follows the "Don't Repeat Yourself" (DRY) principle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Since its first release in 2003&lt;/strong&gt;, Django has been continuously improved by a super-active community where all the new features are discussed, voted, implemented, and later released.&lt;/p&gt;

&lt;p&gt;Today, Django continues to be a widely used and respected web framework, with an active community of developers and a rich ecosystem of packages and extensions.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;👉 Access &lt;a href="https://appseed.us/" rel="noopener noreferrer"&gt;AppSeed&lt;/a&gt; and start your next project&lt;/li&gt;
&lt;li&gt;👉 &lt;a href="https://www.docs.deploypro.dev/" rel="noopener noreferrer"&gt;Deploy Projects on Aws, Azure, and DO&lt;/a&gt; via &lt;strong&gt;DeployPRO&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;👉 Create landing pages with &lt;a href="https://www.simpllo.com/" rel="noopener noreferrer"&gt;Simpllo, an open-source site builder&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;👉 &lt;a href="https://app-generator.dev/django/" rel="noopener noreferrer"&gt;Django App Generator&lt;/a&gt; - A 2nd generation App Builder &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>django</category>
      <category>webdev</category>
      <category>django5release</category>
    </item>
  </channel>
</rss>
