chore: sync content to repo (#9499)

Co-authored-by: kamranahmedse <4921183+kamranahmedse@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2025-12-29 20:57:59 +01:00
committed by GitHub
parent 4def184dd0
commit 127fa7b64e
56 changed files with 435 additions and 56 deletions

View File

@@ -1,3 +1,8 @@
# Django's admin.py
`admin.py` is a Python file within a Django app that's responsible for configuring how your models are displayed and managed in Django's automatically generated admin interface. It allows you to register your models, customize their appearance, add search functionality, and define how they can be edited through the admin site. This file essentially bridges the gap between your data models and the user-friendly admin panel.
`admin.py` is a Python file within a Django app that's responsible for configuring how your models are displayed and managed in Django's automatically generated admin interface. It allows you to register your models, customize their appearance, add search functionality, and define how they can be edited through the admin site. This file essentially bridges the gap between your data models and the user-friendly admin panel.
Visit the following resources to learn more:
- [@official@django-admin and manage.py](https://docs.djangoproject.com/en/6.0/ref/django-admin/)
- [@article@Django Admin](https://www.w3schools.com/django/django_admin.php)

View File

@@ -1,3 +1,10 @@
# Class-Based Views
Class-based views (CBVs) in Django are an alternative way to implement views using Python classes instead of functions. They provide a structured and reusable approach to handling common view logic, promoting code organization and reducing redundancy. CBVs leverage inheritance and mixins to offer a more object-oriented way to define views, making them easier to extend and customize.
Class-based views (CBVs) in Django are an alternative way to implement views using Python classes instead of functions. They provide a structured and reusable approach to handling common view logic, promoting code organization and reducing redundancy. CBVs leverage inheritance and mixins to offer a more object-oriented way to define views, making them easier to extend and customize.
Visit the following resources to learn more:
- [@official@Class-based views](https://docs.djangoproject.com/en/6.0/topics/class-based-views/)
- [@article@What Are Django Class-Based Views (CBVs) & its Advantages in 2024](https://www.horilla.com/blogs/what-are-django-class-based-views-cbvs-and-its-advantages/)
- [@video@What are Django class based views & should you use them?](https://www.youtube.com/watch?v=RE0HlKch_3U)
- [@video@Learn Django Class-Based Views - Using TemplateView - theory and examples](https://www.youtube.com/watch?v=GxA2I-n8NR8&list=PLOLrQ9Pn6caxNb9eFZJ6LfY29nZkKmmXT)

View File

@@ -1,3 +1,8 @@
# Comments in Django Templates
Comments in Django Template Language (DTL) allow developers to embed explanatory notes or temporarily disable sections of template code without affecting the rendered output. These comments are not visible to the end-user in the final HTML. They are useful for documenting the purpose of specific template logic, debugging, or experimenting with different template structures.
Comments in Django Template Language (DTL) allow developers to embed explanatory notes or temporarily disable sections of template code without affecting the rendered output. These comments are not visible to the end-user in the final HTML. They are useful for documenting the purpose of specific template logic, debugging, or experimenting with different template structures.
Visit the following resources to learn more:
- [@official@comments](https://docs.djangoproject.com/en/6.0/ref/templates/builtins/#comment)
- [@article@Django comment Tag](https://www.w3schools.com/django/django_tags_comment.php)

View File

@@ -1,3 +1,10 @@
# CreateView
`CreateView` is a powerful generic class-based view in Django that simplifies the process of creating new objects in your database. It handles displaying a form for creating the object, validating the submitted data, and saving the new object to the database if the data is valid. It's designed to reduce boilerplate code when you need to create model instances through a web interface.
`CreateView` is a powerful generic class-based view in Django that simplifies the process of creating new objects in your database. It handles displaying a form for creating the object, validating the submitted data, and saving the new object to the database if the data is valid. It's designed to reduce boilerplate code when you need to create model instances through a web interface.
Visit the following resources to learn more:
- [@official@CreateView](https://docs.djangoproject.com/en/6.0/ref/class-based-views/generic-editing/#django.views.generic.edit.CreateView)
- [@article@Django Class Based Views(CreateView)](https://medium.com/@hellenwain_54279/django-class-based-views-createview-b7c7ead3085)
- [@article@Learn Django Class Based Views - CreateView - Theory and Examples](https://www.youtube.com/watch?v=nW-srV0kKKk)
- [@video@Learn Django Class Based Views - CreateView - Theory and Examples](https://www.youtube.com/watch?v=dOG-aRADaD8)

View File

@@ -1,3 +1,11 @@
# Custom Fields
Custom fields in Django allow you to define your own field types beyond the standard ones provided by Django, such as CharField, IntegerField, and DateTimeField. This is useful when you need to store data in a specific format or require specialized validation logic that isn't covered by the built-in field types. By creating custom fields, you can seamlessly integrate your unique data requirements into your Django models.
Custom fields in Django allow you to define your own field types beyond the standard ones provided by Django, such as CharField, IntegerField, and DateTimeField. This is useful when you need to store data in a specific format or require specialized validation logic that isn't covered by the built-in field types. By creating custom fields, you can seamlessly integrate your unique data requirements into your Django models.
Visit the following resources to learn more:
- [@official@How to create custom model fields](https://docs.djangoproject.com/en/6.0/howto/custom-model-fields/)
- [@article@Django: using custom classes for model fields](https://medium.com/@luccascorrea/django-using-custom-classes-for-model-fields-38e58914ba5c)
- [@article@How to Create Custom Model Fields in Django [2024]](https://www.horilla.com/blogs/how-to-create-custom-model-fields-in-django/)
- [@video@Django ORM - Creating a Custom field Subclass](https://www.youtube.com/watch?v=b10NxZ7JEjE)
- [@video@Django ORM - Introducing Custom Model Fields](https://www.youtube.com/watch?v=pJXKTcYo3ls)

View File

@@ -1,3 +1,10 @@
# Customizing Views
Customizing views in Django involves modifying the default behavior of view functions or classes to suit specific application needs. This can include adding extra context data, altering the template used for rendering, or overriding methods in class-based views to change how they handle requests and responses. Customization allows developers to tailor the view logic to precisely match the requirements of different features and functionalities within a Django project.
Customizing views in Django involves modifying the default behavior of view functions or classes to suit specific application needs. This can include adding extra context data, altering the template used for rendering, or overriding methods in class-based views to change how they handle requests and responses. Customization allows developers to tailor the view logic to precisely match the requirements of different features and functionalities within a Django project.
Visit the following resources to learn more:
- [@official@View decorators](https://docs.djangoproject.com/en/6.0/topics/http/decorators/)
- [@article@An Introduction to Django Views](https://blog.jetbrains.com/pycharm/2025/01/django-views/)
- [@article@Customising Djangos Class-based view.](https://medium.com/@krystianmaccs_66962/customising-djangos-class-based-view-e2ed0312a037)
- [@video@How to Create Custom Views in Python Django | Step-by-Step Tutorial](https://www.youtube.com/watch?v=ZigbVn5gKZA)

View File

@@ -1,3 +1,9 @@
# DeleteView
`DeleteView` in Django is a pre-built class-based view designed to handle the deletion of a specific object from your database. It provides a structured way to present a confirmation page to the user, process the deletion upon confirmation, and then redirect the user to another page. This simplifies the process of creating views that handle object deletion, reducing boilerplate code.
`DeleteView` in Django is a pre-built class-based view designed to handle the deletion of a specific object from your database. It provides a structured way to present a confirmation page to the user, process the deletion upon confirmation, and then redirect the user to another page. This simplifies the process of creating views that handle object deletion, reducing boilerplate code.
Visit the following resources to learn more:
- [@official@DeleteView](https://docs.djangoproject.com/en/6.0/ref/class-based-views/generic-editing/#django.views.generic.edit.DeleteView)
- [@article@Django DeleteView](https://www.pythontutorial.net/django-tutorial/django-deleteview/)
- [@article@Try DJANGO Tutorial - 39 - Class Based Views - DeleteView](https://www.youtube.com/watch?v=a718ii0Lf6M)

View File

@@ -1,3 +1,11 @@
# DetailView
DetailView is a pre-built class-based view in Django that simplifies the process of displaying the details of a single object. It automatically fetches an object from the database based on a provided lookup (typically a primary key or slug) and renders it using a specified template. This eliminates the need to write repetitive code for common detail view scenarios.
DetailView is a pre-built class-based view in Django that simplifies the process of displaying the details of a single object. It automatically fetches an object from the database based on a provided lookup (typically a primary key or slug) and renders it using a specified template. This eliminates the need to write repetitive code for common detail view scenarios.
Visit the following resources to learn more:
- [@official@DetailView](https://docs.djangoproject.com/en/6.0/ref/class-based-views/generic-display/#detailview)
- [@article@Django DetailView](https://www.pythontutorial.net/django-tutorial/django-detailview/)
- [@article@Django Tutorial Part 6: Generic list and detail views](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Server-side/Django/Generic_views)
- [@video@Django 2 for Beginners #23 DetailView](https://www.youtube.com/watch?v=IkqsW8slOO0)
- [@video@Django Full Course - 20.1 - Class Based Views. Built-in generic views (ListView, DetailView)](https://www.youtube.com/watch?v=SCvFhXNVVvs)

View File

@@ -1,3 +1,9 @@
# DTL Syntax
The Django Template Language (DTL) syntax defines how dynamic content and logic are embedded within HTML templates. It uses tags, variables, and filters to render data from the Django backend into the final HTML output displayed to the user. These elements allow developers to create dynamic web pages by inserting data, performing simple logic, and controlling the structure of the template.
The Django Template Language (DTL) syntax defines how dynamic content and logic are embedded within HTML templates. It uses tags, variables, and filters to render data from the Django backend into the final HTML output displayed to the user. These elements allow developers to create dynamic web pages by inserting data, performing simple logic, and controlling the structure of the template.
Visit the following resources to learn more:
- [@official@The Django template language](https://docs.djangoproject.com/en/6.0/ref/templates/language/)
- [@article@Django - Template System](https://www.tutorialspoint.com/django/django_template_system.htm)
- [@video@#5 Django tutorials | Django Template Language | DTL](https://www.youtube.com/watch?v=GNlIe5zvBeQ)

View File

@@ -1,3 +1,10 @@
# Field Options in Django Models
Field options are attributes you can define within a Django model's field to control its behavior and characteristics. These options allow you to specify constraints, default values, validation rules, and other metadata for each field, influencing how data is stored, displayed, and handled within your application. They provide a way to customize the fields to meet the specific requirements of your data and application logic.
Field options are attributes you can define within a Django model's field to control its behavior and characteristics. These options allow you to specify constraints, default values, validation rules, and other metadata for each field, influencing how data is stored, displayed, and handled within your application. They provide a way to customize the fields to meet the specific requirements of your data and application logic.
Visit the following resources to learn more:
- [@official@Field options](https://docs.djangoproject.com/en/6.0/topics/db/models/#field-options)
- [@official@Field options](https://docs.djangoproject.com/en/6.0/ref/models/fields/#field-options)
- [@article@Django model fields options](https://swesadiqul.medium.com/django-model-fields-options-8f3651dade6a)
- [@video@Field types and options in Django models](https://www.youtube.com/watch?v=u7MJxv_P2Pk)

View File

@@ -1 +1,12 @@
# Fields types
# Model Field Types
Model field types define the kind of data a field in your Django model can hold, such as text, numbers, dates, or relationships to other models. Each field type corresponds to a specific data type in the database and provides built-in validation and form handling. Choosing the right field type is crucial for data integrity and efficient database storage.
Visit the following resources to learn more:
- [@official@Fields](https://docs.djangoproject.com/en/6.0/topics/db/models/#fields)
- [@official@Model field reference](https://docs.djangoproject.com/en/6.0/ref/models/fields/)
- [@article@Django Model Fields Common Use Cases and How They Work](https://www.freecodecamp.org/news/common-django-model-fields-and-their-use-cases/)
- [@article@What are the Different Field Types in Django?](https://www.horilla.com/blogs/what-are-the-different-field-types-in-django/)
- [@video@Field types and options in Django models](https://www.youtube.com/watch?v=u7MJxv_P2Pk)
- [@video@Django Full Course - 1.0 - Introduction to models. Fields and field types](https://www.youtube.com/watch?v=1danN1DTzFI)

View File

@@ -1,3 +1,11 @@
# Filters & Custom Filters
Filters in Django Template Language (DTL) are used to modify the output of variables. They are applied using a pipe `|` symbol and can perform various transformations like changing case, formatting dates, or truncating text. Custom filters allow developers to define their own reusable template tags to perform specific data manipulations not covered by the built-in filters.
Filters in Django Template Language (DTL) are used to modify the output of variables. They are applied using a pipe `|` symbol and can perform various transformations like changing case, formatting dates, or truncating text. Custom filters allow developers to define their own reusable template tags to perform specific data manipulations not covered by the built-in filters.
Visit the following resources to learn more:
- [@official@Filters](https://docs.djangoproject.com/en/6.0/ref/templates/language/#filters)
- [@official@Built-in template tags and filters](https://docs.djangoproject.com/en/6.0/ref/templates/builtins/)
- [@article@filter Template Tag](https://www.w3schools.com/django/ref_tags_filter.php)
- [@article@Django Templates: Implementing Custom Tags and Filters](https://realpython.com/django-template-custom-tags-filters/)
- [@video@Creating Custom Template Filters in Django!](https://www.youtube.com/watch?v=g2WkvFSVce8)

View File

@@ -1,3 +1,8 @@
# For Loop in Django Templates
The `for` tag in Django Template Language (DTL) provides a way to iterate over items in a list or other iterable object within your templates. It allows you to display data dynamically by looping through each item and rendering it according to the template's structure. You can access loop-specific variables like the current iteration number and whether it's the first or last item.
The `for` tag in Django Template Language (DTL) provides a way to iterate over items in a list or other iterable object within your templates. It allows you to display data dynamically by looping through each item and rendering it according to the template's structure. You can access loop-specific variables like the current iteration number and whether it's the first or last item.
Visit the following resources to learn more:
- [@official@for](https://docs.djangoproject.com/en/6.0/ref/templates/builtins/#for)
- [@article@Django for Tag](https://www.w3schools.com/django/django_tags_for.php)

View File

@@ -1,3 +1,11 @@
# Function-Based Views
Function-based views in Django are Python functions that take a web request and return a web response. They are a simple and direct way to handle HTTP requests and generate the appropriate output, such as HTML, JSON, or redirects. These views provide a basic structure for processing user input, interacting with models, and rendering templates.
Function-based views in Django are Python functions that take a web request and return a web response. They are a simple and direct way to handle HTTP requests and generate the appropriate output, such as HTML, JSON, or redirects. These views provide a basic structure for processing user input, interacting with models, and rendering templates.
Visit the following resources to learn more:
- [@official@Writing views](https://docs.djangoproject.com/en/6.0/topics/http/views/#a-simple-view)
- [@article@Django Functional Based Views](https://medium.com/@rkiptoo5244/django-functional-based-views-37c1d560d154)
- [@article@Class-based vs Function-based Views in Django](https://testdriven.io/blog/django-class-based-vs-function-based-views/)
- [@video@Why I Use Django Function Based Views](https://www.youtube.com/watch?v=mKzStOGIc4A)
- [@video@Creating function based views in Django [16 of 24] | Django for Beginners](https://www.youtube.com/watch?v=IYr430whtzY)

View File

@@ -1,3 +1,10 @@
# Generic Views
Generic views in Django are pre-built views that handle common web development tasks, like displaying a list of objects, creating new objects, or updating existing ones. They reduce the amount of boilerplate code you need to write by providing reusable logic for interacting with your models and templates. Instead of writing custom view functions for each task, you can configure these generic views to suit your specific needs.
Generic views in Django are pre-built views that handle common web development tasks, like displaying a list of objects, creating new objects, or updating existing ones. They reduce the amount of boilerplate code you need to write by providing reusable logic for interacting with your models and templates. Instead of writing custom view functions for each task, you can configure these generic views to suit your specific needs.
Visit the following resources to learn more:
- [@official@Built-in class-based generic views](https://docs.djangoproject.com/en/6.0/topics/class-based-views/generic-display/)
- [@article@Django Class-Based Views vs Generic Class-Based Views](https://medium.com/@ashishpandey2062/django-class-based-views-vs-generic-class-based-views-2ce548c073db)
- [@article@Class-Based Generic Views in Django](https://thoughtbot.com/blog/class-based-generic-views-in-django)
- [@video@Django - Generic & Class-Based Views! (an alternative to functions)](https://www.youtube.com/watch?v=DDIP-icVpA8)

View File

@@ -1,3 +1,3 @@
# Handlers
Handlers in Django's logging framework determine *where* log messages go. They act as the delivery mechanism, taking log records created by loggers and sending them to specific destinations. These destinations can include the console, files, email addresses, or even external services. Different handlers can be configured to handle different log levels, allowing you to route critical errors to one location and less severe warnings to another.
Handlers in Django's logging framework determine _where_ log messages go. They act as the delivery mechanism, taking log records created by loggers and sending them to specific destinations. These destinations can include the console, files, email addresses, or even external services. Different handlers can be configured to handle different log levels, allowing you to route critical errors to one location and less severe warnings to another.

View File

@@ -1,3 +1,10 @@
# How the Web Works
The web operates through a client-server model where a client (like a web browser) sends a request to a server, and the server processes that request and sends back a response. This interaction involves protocols like HTTP for communication, URLs to identify resources, and DNS to translate domain names into IP addresses, enabling users to access and interact with content hosted on servers across the internet.
The web operates through a client-server model where a client (like a web browser) sends a request to a server, and the server processes that request and sends back a response. This interaction involves protocols like HTTP for communication, URLs to identify resources, and DNS to translate domain names into IP addresses, enabling users to access and interact with content hosted on servers across the internet.
Visit the following resources to learn more:
- [@article@Introduction to the Internet](https://roadmap.sh/guides/what-is-internet)
- [@article@How does the Internet Work?](https://cs.fyi/guide/how-does-internet-work)
- [@article@How does the Internet work? | MDN Dcos](https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Web_mechanics/How_does_the_Internet_work)
- [@video@How the Internet Works in 5 Minutes](https://www.youtube.com/watch?v=7_LPdttKXPc)

View File

@@ -1,3 +1,8 @@
# Conditional Logic in Django Templates
The `if` tag in Django Template Language (DTL) allows you to control which parts of your template are rendered based on the truthiness of a variable or expression. It evaluates a variable, and if that variable is "true" (i.e., exists, is not empty, and is not a false boolean value), the block of code within the `if` tag is rendered. You can also use `elif` and `else` tags to create more complex conditional logic.
The `if` tag in Django Template Language (DTL) allows you to control which parts of your template are rendered based on the truthiness of a variable or expression. It evaluates a variable, and if that variable is "true" (i.e., exists, is not empty, and is not a false boolean value), the block of code within the `if` tag is rendered. You can also use `elif` and `else` tags to create more complex conditional logic.
Visit the following resources to learn more:
- [@article@if](https://docs.djangoproject.com/en/6.0/ref/templates/builtins/#if)
- [@article@if Template Tag](https://www.w3schools.com/django/ref_tags_if.php)

View File

@@ -1,3 +1,10 @@
# Installing Django
Installing Django involves setting up the Django package on your system so you can start developing web applications. This typically involves using a package installer like pip to download and install the necessary files and dependencies. Once installed, you can verify the installation and begin creating your Django project.
Installing Django involves setting up the Django package on your system so you can start developing web applications. This typically involves using a package installer like pip to download and install the necessary files and dependencies. Once installed, you can verify the installation and begin creating your Django project.
Visit the following resources to learn more:
- [@official@How to install Django](https://docs.djangoproject.com/en/6.0/topics/install/)
- [@official@How to get Django](https://www.djangoproject.com/download/)
- [@article@Django Getting Started](https://www.w3schools.com/django/django_getstarted.php)
- [@video@How To Install Django For Python 3.11.3 | PIP and Django on Windows 10/11 | Django Tutorials](https://www.youtube.com/watch?v=Uq7TkegTXRU)

View File

@@ -1,3 +1,14 @@
# Introduction
Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel. Django follows the model-template-views (MTV) architectural pattern, providing a structured way to build web applications.
Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel. Django follows the model-template-views (MTV) architectural pattern, providing a structured way to build web applications.
Visit the following resources to learn more:
- [@official@Django](https://www.djangoproject.com/start/overview/)
- [@official@Django Docs](https://docs.djangoproject.com/en/)
- [@article@Django Introduction](https://www.w3schools.com/django/django_intro.php)
- [@course@Python Django 101](https://www.simplilearn.com/free-python-django-course-skillup)
- [@book@Django for Professionals](http://ia800604.us.archive.org/3/items/ebooks_202307/djangoforprofessionals.pdf)
- [@video@Django Crash Course Python Web Framework](https://www.youtube.com/watch?v=0roB7wZMLqI)
- [@video@Django Tutorial for Beginners Build Powerful Backends](https://www.youtube.com/watch?v=rHux0gMZ3Eg)
- [@video@Django For Everybody - Full Python University Course](https://www.youtube.com/watch?v=o0XbHvKxw7Y)

View File

@@ -1,3 +1,11 @@
# ListView
ListView is a type of generic view in Django that simplifies the process of displaying a list of objects from a database. It automates tasks like fetching data, paginating results, and rendering a template with the list of objects, reducing the amount of boilerplate code you need to write when creating list views.
ListView is a type of generic view in Django that simplifies the process of displaying a list of objects from a database. It automates tasks like fetching data, paginating results, and rendering a template with the list of objects, reducing the amount of boilerplate code you need to write when creating list views.
Visit the following resources to learn more:
- [@official@ListView](https://docs.djangoproject.com/en/6.0/ref/class-based-views/generic-display/)
- [@article@Django Tutorial Part 6: Generic list and detail views](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Server-side/Django/Generic_views#overview)
- [@article@Django ListView](https://www.pythontutorial.net/django-tutorial/django-listview/)
- [@video@The Basics of Django ListView](https://www.youtube.com/watch?v=J74OTEhmLU0)
- [@video@Django Full Course - 20.1 - Class Based Views. Built-in generic views (ListView, DetailView)](https://www.youtube.com/watch?v=SCvFhXNVVvs)

View File

@@ -1,3 +1,9 @@
# manage.py
`manage.py` is a command-line utility that's automatically created when you start a new Django project. It acts as a central point for running administrative tasks related to your project, such as starting the development server, running tests, creating database migrations, and more. Think of it as a helper script that simplifies interacting with your Django project from the command line.
`manage.py` is a command-line utility that's automatically created when you start a new Django project. It acts as a central point for running administrative tasks related to your project, such as starting the development server, running tests, creating database migrations, and more. Think of it as a helper script that simplifies interacting with your Django project from the command line.
Visit the following resources to learn more:
- [@article@Writing your first Django app, part 1](https://docs.djangoproject.com/en/6.0/intro/tutorial01/)
- [@article@django-admin and manage.py¶](https://docs.djangoproject.com/en/6.0/ref/django-admin/)
- [@video@Python Basics Tutorial Django Manage.py Startapp](https://www.youtube.com/watch?v=s0Ca-Tdon9Y)

View File

@@ -1,3 +1,7 @@
# Media Folder
The media folder in a Django project is where you store user-uploaded files like images, videos, and documents. Django doesn't automatically create this folder; you typically create it yourself at the project's root or within an app. You'll configure Django to know where this folder is located so it can serve these files correctly.
The media folder in a Django project is where you store user-uploaded files like images, videos, and documents. Django doesn't automatically create this folder; you typically create it yourself at the project's root or within an app. You'll configure Django to know where this folder is located so it can serve these files correctly.
Visit the following resources to learn more:
- [@article@Working with Static and Media Files in Django](https://testdriven.io/blog/django-static-files/)

View File

@@ -1,3 +1,9 @@
# Migrations
Migrations in Django are a way to propagate changes you make to your models (like adding a field, deleting a model, etc.) into your database schema. They are essentially Python files that describe how to alter your database tables to match the current state of your models. Django uses these files to keep your database schema in sync with your application's models over time.
Migrations in Django are a way to propagate changes you make to your models (like adding a field, deleting a model, etc.) into your database schema. They are essentially Python files that describe how to alter your database tables to match the current state of your models. Django uses these files to keep your database schema in sync with your application's models over time.
Visit the following resources to learn more:
- [@official@Migrations](https://docs.djangoproject.com/en/6.0/topics/migrations/)
- [@article@Part-2: Migrations Files in Django Framework](https://medium.com/@altafkhan_24475/part-2-migrations-files-in-django-framework-486b9d4e173b)
- [@article@How To Get Up And Running With Django Migrations: A Guide](https://coderpad.io/blog/development/how-to-get-up-and-running-with-django-migrations-a-guide/)

View File

@@ -1,3 +1,11 @@
# Model Inheritance
Model inheritance in Django allows you to create new models that inherit fields and behaviors from existing models. This promotes code reuse and helps establish relationships between different data entities in your application. By inheriting from a base model, you can avoid redefining common fields and methods, making your code more organized and maintainable.
Model inheritance in Django allows you to create new models that inherit fields and behaviors from existing models. This promotes code reuse and helps establish relationships between different data entities in your application. By inheriting from a base model, you can avoid redefining common fields and methods, making your code more organized and maintainable.
Visit the following resources to learn more:
- [@official@Model inheritance](https://docs.djangoproject.com/fr/2.2/topics/db/models/#model-inheritance)
- [@article@Understanding Django-Advanced Model Inheritance.](https://foysalff.medium.com/understanding-django-model-inheritance-b0c38588ebb4)
- [@article@Django Model Inheritance](https://dev.to/highcenburg/django-model-inheritance-4f3p)
- [@video@Django Model Inheritance Options Introduction - ORM Part-9](https://www.youtube.com/watch?v=4Xag2FzmN60)
- [@video@Django Model Inheritance - Abstract Models and Multi-Table Inheritance](https://www.youtube.com/watch?v=KSPRODsdfo4)

View File

@@ -1,3 +1,10 @@
# Model Methods
Model methods are functions you define within a Django model class to add custom behavior to individual model instances. These methods allow you to encapsulate logic related to a specific object, such as calculating derived values, performing data manipulations, or implementing custom validation rules. They provide a clean and organized way to extend the functionality of your models beyond the basic fields and relationships.
Model methods are functions you define within a Django model class to add custom behavior to individual model instances. These methods allow you to encapsulate logic related to a specific object, such as calculating derived values, performing data manipulations, or implementing custom validation rules. They provide a clean and organized way to extend the functionality of your models beyond the basic fields and relationships.
Visit the following resources to learn more:
- [@official@Model methods](https://docs.djangoproject.com/en/6.0/topics/db/models/#model-methods)
- [@article@An Overview of Django Model Methods in 2023](https://www.horilla.com/blogs/an-overview-of-django-model-methods-in-2023/)
- [@video@Django Model Properties & Methods | @property decorator | get_absolute_url() method](https://www.youtube.com/watch?v=PgHaH8tGdWw)
- [@video@Django Tutorial #11 - Model Methods](https://www.youtube.com/watch?v=ERCt6HUcaFw)

View File

@@ -1,3 +1,11 @@
# Model Relationships
Model relationships in Django define how different models (database tables) are connected. These relationships allow you to link related data, such as a blog post belonging to a specific author or a customer having multiple orders. Django provides different types of relationships like One-to-One, One-to-Many (ForeignKey), and Many-to-Many to represent these connections effectively in your database schema.
Model relationships in Django define how different models (database tables) are connected. These relationships allow you to link related data, such as a blog post belonging to a specific author or a customer having multiple orders. Django provides different types of relationships like One-to-One, One-to-Many (ForeignKey), and Many-to-Many to represent these connections effectively in your database schema.
Visit the following resources to learn more:
- [@official@Relationships](https://docs.djangoproject.com/en/6.0/topics/db/models/#relationships)
- [@official@Examples of model relationship API usage](https://docs.djangoproject.com/en/6.0/topics/db/examples/)
- [@article@How to Define Relationships Between Django Models](https://www.freecodecamp.org/news/django-model-relationships/)
- [@video@Understanding Django Model Relationships](http://youtube.com/watch?v=2KqhBkMv7aM)
- [@video@Database Relationships | One To Many & Many to Many | Django (3.0) Crash Course Tutorials (pt 6)](https://www.youtube.com/watch?v=wIPHER2UBB4)

View File

@@ -1,3 +1,12 @@
# Models
Models are Python classes that represent database tables. Each model attribute represents a database field. Django uses these models to interact with the database, allowing you to create, read, update, and delete data without writing raw SQL queries. They define the structure of your data and provide a high-level interface for database operations.
Models are Python classes that represent database tables. Each model attribute represents a database field. Django uses these models to interact with the database, allowing you to create, read, update, and delete data without writing raw SQL queries. They define the structure of your data and provide a high-level interface for database operations.
Visit the following resources to learn more:
- [@official@Models](https://docs.djangoproject.com/en/6.0/topics/db/models/)
- [@article@Django Models](https://www.w3schools.com/django/django_models.php)
- [@article@Django Tutorial Part 3: Using models](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Server-side/Django/Models)
- [@article@Django models](https://tutorial.djangogirls.org/en/django_models/)
- [@video@Python Django Models and Migrations](https://www.youtube.com/watch?v=5DW4Ky1Um4o)
- [@video@Django Models | Crash Course | Field Types, Connections, and Model Functions](https://www.youtube.com/watch?v=RbJOmgTX63M)

View File

@@ -1,3 +1,9 @@
# Models.py
`models.py` is a Python file within a Django app that defines the structure of your application's data. It contains classes that represent database tables, with each class attribute representing a field in the table. These models allow you to interact with your database using Python code, abstracting away the complexities of raw SQL queries.
`models.py` is a Python file within a Django app that defines the structure of your application's data. It contains classes that represent database tables, with each class attribute representing a field in the table. These models allow you to interact with your database using Python code, abstracting away the complexities of raw SQL queries.
Visit the following resources to learn more:
- [@official@Models](https://docs.djangoproject.com/en/6.0/topics/db/models/)
- [@article@Django models](https://www.w3schools.com/django/django_models.php)
- [@article@What exactly is model.py and how does it works?](https://medium.com/@stefano.passaro/what-exactly-is-model-py-and-how-does-it-works-31c3ab35af11)

View File

@@ -1,3 +1,10 @@
# Named URLs
Named URLs in Django provide a way to refer to your URL patterns by name instead of hardcoding the URL strings in your templates and views. This allows you to change your URL structure without having to update every place where the URL is used, making your code more maintainable and less prone to errors. By assigning a unique name to each URL pattern, you can use this name to dynamically generate URLs, ensuring that your links remain consistent even if the underlying URL structure changes.
Named URLs in Django provide a way to refer to your URL patterns by name instead of hardcoding the URL strings in your templates and views. This allows you to change your URL structure without having to update every place where the URL is used, making your code more maintainable and less prone to errors. By assigning a unique name to each URL pattern, you can use this name to dynamically generate URLs, ensuring that your links remain consistent even if the underlying URL structure changes.
Visit the following resources to learn more:
- [@official@Naming URL patterns](https://docs.djangoproject.com/en/6.0/topics/http/urls/#naming-url-patterns)
- [@article@Named URL patterns](https://www.hostinger.com/my/tutorials/django-url-patterns#Named_URL_patterns)
- [@video@Django Tutorial #15 - Named URL's](https://www.youtube.com/watch?v=07YSCsscYhc)
- [@video@Django URLs - Named URLS, url template-tag, Reversing URLs, URL namespaces, & get_absolute_url()](https://www.youtube.com/watch?v=obRENgwHS7A)

View File

@@ -1,3 +1,10 @@
# Path Converters
Path converters in Django are special strings within URL patterns that capture specific parts of the URL and pass them as arguments to your view functions. They define the type of data expected in that part of the URL (like an integer, string, or slug) and ensure that the data is correctly formatted before being passed to the view. This allows you to create dynamic URLs that can handle different types of input and simplifies the process of extracting data from the URL for use in your application logic.
Path converters in Django are special strings within URL patterns that capture specific parts of the URL and pass them as arguments to your view functions. They define the type of data expected in that part of the URL (like an integer, string, or slug) and ensure that the data is correctly formatted before being passed to the view. This allows you to create dynamic URLs that can handle different types of input and simplifies the process of extracting data from the URL for use in your application logic.
Visit the following resources to learn more:
- [@official@Path converters](https://docs.djangoproject.com/en/6.0/topics/http/urls/#path-converters)
- [@article@Django: write a custom URL path converter to match given strings](https://adamj.eu/tech/2025/08/01/django-custom-url-converter-string/)
- [@article@Path Converters in Django: Customizing Your URL Patterns](https://python.plainenglish.io/path-converters-in-django-customizing-your-url-patterns-19791b6401f4)
- [@video@Django Path Converters - Built-in Converters and Writing Custom Converters!](https://www.youtube.com/watch?v=hrfqwj7JCAc)

View File

@@ -1,3 +1,9 @@
# Projects & Apps
In Django, a project is a collection of settings and configurations for a particular website or web application. An app, on the other hand, is a modular, reusable component that performs a specific function within that project, like handling user authentication, managing blog posts, or processing payments. A project can contain multiple apps, and an app can be used in multiple projects.
In Django, a project is a collection of settings and configurations for a particular website or web application. An app, on the other hand, is a modular, reusable component that performs a specific function within that project, like handling user authentication, managing blog posts, or processing payments. A project can contain multiple apps, and an app can be used in multiple projects.
Visit the following resources to learn more:
- [@official@Writing your first Django app, part 1](https://docs.djangoproject.com/en/6.0/intro/tutorial01/)
- [@official@Django Create Project](https://www.w3schools.com/django/django_create_project.php)
- [@video@How to Create Frist Django Project in Visual Studio Code (2024)](https://www.youtube.com/watch?v=fxcOtcYYqA0)

View File

@@ -1,3 +1,11 @@
# Regex Paths
Regular expression paths in Django provide a powerful and flexible way to define URL patterns. Instead of using simple string matching, you can use regular expressions to capture specific parts of the URL and pass them as arguments to your view functions. This allows you to create dynamic and complex URL structures that can handle a wide range of user requests.
Regular expression paths in Django provide a powerful and flexible way to define URL patterns. Instead of using simple string matching, you can use regular expressions to capture specific parts of the URL and pass them as arguments to your view functions. This allows you to create dynamic and complex URL structures that can handle a wide range of user requests.
Visit the following resources to learn more:
- [@official@Using regular expressions](https://docs.djangoproject.com/en/6.0/topics/http/urls/#using-regular-expressions)
- [@article@Understanding Django URL patterns](https://www.hostinger.com/my/tutorials/django-url-patterns)
- [@article@How Django URLs work with Regular Expressions](https://www.codingforentrepreneurs.com/blog/how-django-urls-work-with-regular-expressions)
- [@video@How Django URLs work with Regular Expressions](https://www.youtube.com/watch?v=8rExil_EWtk)
- [@video@Learning Django - How to use url mapping with regexp (regular expression) in Django](https://www.youtube.com/watch?v=5zJ3LPWlfqU)

View File

@@ -1,3 +1,11 @@
# Request-Response Flow in Django
The request-response flow describes how a web application handles incoming requests from users and generates appropriate responses. When a user interacts with a website (e.g., clicks a link or submits a form), their browser sends a request to the server. The server then processes this request, potentially interacting with a database or other resources, and ultimately sends back a response to the user's browser, which then renders the content for the user to see.
The request-response flow describes how a web application handles incoming requests from users and generates appropriate responses. When a user interacts with a website (e.g., clicks a link or submits a form), their browser sends a request to the server. The server then processes this request, potentially interacting with a database or other resources, and ultimately sends back a response to the user's browser, which then renders the content for the user to see.
Visit the following resources to learn more:
- [@official@Request and response objects](https://docs.djangoproject.com/en/6.0/ref/request-response/)
- [@article@Django Request-Response Cycle?](https://medium.com/@developerstacks/django-request-response-cycle-7165167f54c5)
- [@article@Django Request Life Cycle Explained](https://dev.to/nilebits/django-request-life-cycle-explained-ci6)
- [@video@Python Django Course | Understanding the Django Request Response Cycle](https://www.youtube.com/watch?v=9X83BZ1cF7o)
- [@video@09 - Django Request Response Cycle | Official Django Polls Companion Videos](https://www.youtube.com/watch?v=TRZtGJP-BTc)

View File

@@ -1,3 +1,9 @@
# Reverse URL
Reverse URL resolution is the process of generating URLs from their names and arguments, instead of hardcoding them directly into your templates or views. This allows you to make changes to your URL patterns without having to update every part of your application that uses those URLs. By using named URL patterns, you can dynamically construct URLs based on the current configuration, making your application more maintainable and flexible.
Reverse URL resolution is the process of generating URLs from their names and arguments, instead of hardcoding them directly into your templates or views. This allows you to make changes to your URL patterns without having to update every part of your application that uses those URLs. By using named URL patterns, you can dynamically construct URLs based on the current configuration, making your application more maintainable and flexible.
Visit the following resources to learn more:
- [@official@Reverse resolution of URLs](https://docs.djangoproject.com/en/6.0/topics/http/urls/#reverse-resolution-of-urls)
- [@article@Django Reverse](https://www.scaler.com/topics/django/django-reverse/)
- [@video@45 - Django URLs Reverse - Python & Django 3.2 Tutorial Series](https://www.youtube.com/watch?v=rm2YTMc2s10)

View File

@@ -1,3 +1,10 @@
# Running Your Django Project
Running a Django project involves starting a local development server that allows you to view and interact with your web application in a browser. This server listens for incoming requests and serves the appropriate content, enabling you to test and debug your project during development. It's a crucial step in the Django development workflow, allowing you to see your code in action.
Running a Django project involves starting a local development server that allows you to view and interact with your web application in a browser. This server listens for incoming requests and serves the appropriate content, enabling you to test and debug your project during development. It's a crucial step in the Django development workflow, allowing you to see your code in action.
Visit the following resources to learn more:
- [@official@Writing your first Django app, part 1](https://docs.djangoproject.com/en/6.0/intro/tutorial01/)
- [@article@Django Create Project](https://www.w3schools.com/django/django_create_project.php)
- [@video@How to Start a Django Project and Run the Development Server](https://www.youtube.com/watch?v=PBh6XkFobes)
- [@video@How to Create Frist Django Project in Visual Studio Code (2024)](https://www.youtube.com/watch?v=fxcOtcYYqA0)

View File

@@ -1,3 +1,9 @@
# Routing Middleware
Middleware in Django is a framework of hooks into Django's request/response processing. It's a layer of code that sits between the web server and your Django views, processing every request and response in your application. This allows you to modify the request before it reaches your view, or modify the response before it's sent to the user, enabling functionalities like authentication, session management, and request logging.
Middleware in Django is a framework of hooks into Django's request/response processing. It's a layer of code that sits between the web server and your Django views, processing every request and response in your application. This allows you to modify the request before it reaches your view, or modify the response before it's sent to the user, enabling functionalities like authentication, session management, and request logging.
Visit the following resources to learn more:
- [@official@Middleware](https://docs.djangoproject.com/en/6.0/topics/http/middleware/)
- [@article@Understanding Django Middleware: How to Create Custom Middleware](https://medium.com/@farad.dev/understanding-django-middleware-how-to-create-custom-middleware-789744722df3)
- [@video@Writing Django Middleware (with tests!) | HTMX middleware | IP Blacklist middleware](https://www.youtube.com/watch?v=--ddZc39wVQ)

View File

@@ -1,3 +1,10 @@
# Database Setup in Django
Setting up the database in Django involves configuring your project to connect to and interact with a specific database management system (DBMS). This process includes specifying the database type (e.g., PostgreSQL, MySQL, SQLite), providing connection details like the database name, username, password, and host, and ensuring that Django can communicate with the database to store and retrieve data for your application.
Setting up the database in Django involves configuring your project to connect to and interact with a specific database management system (DBMS). This process includes specifying the database type (e.g., PostgreSQL, MySQL, SQLite), providing connection details like the database name, username, password, and host, and ensuring that Django can communicate with the database to store and retrieve data for your application.
Visit the following resources to learn more:
- [@roadmap@Visit the Dedicated SQL Roadmap](https://roadmap.sh/sql)
- [@official@Databases](https://docs.djangoproject.com/en/6.0/ref/databases/)
- [@official@Writing your first Django app, part 2](https://docs.djangoproject.com/en/6.0/intro/tutorial02/)
- [@video@Django Tutorial #4 - Database Setup](https://www.youtube.com/watch?v=DZVFgMSyRXI)

View File

@@ -1,3 +1,11 @@
# settings.py
`settings.py` is a crucial Python module in a Django project that contains global configurations and settings for the entire application. It defines things like database connections, installed apps, middleware, template locations, and security settings. This file essentially acts as the central control panel for your Django project, allowing you to customize its behavior and functionality.
`settings.py` is a crucial Python module in a Django project that contains global configurations and settings for the entire application. It defines things like database connections, installed apps, middleware, template locations, and security settings. This file essentially acts as the central control panel for your Django project, allowing you to customize its behavior and functionality.
Visit the following resources to learn more:
- [@official@Django settings](https://docs.djangoproject.com/en/6.0/topics/settings/)
- [@official@Settings](https://docs.djangoproject.com/en/6.0/ref/settings/)
- [@article@Understanding Django's settings.py File: A Comprehensive Guide for Beginners](https://dev.to/rupesh_mishra/understanding-djangos-settingspy-file-a-comprehensive-guide-for-beginners-35e2)
- [@article@Understanding Django's settings.py: A Deep Dive](https://lavishchhatwani.com/f/understanding-djangos-settingspy-a-deep-dive)
- [@video@settings.py configuration in django | django settings.py explained | django full tutorial | #04](https://www.youtube.com/watch?v=uGcmzeU1tmQ)

View File

@@ -1,3 +1,11 @@
# SQLite in Django
SQLite is a self-contained, serverless, zero-configuration, transactional SQL database engine. It's embedded directly into the application, meaning it doesn't require a separate server process to operate. This makes it a lightweight and convenient choice for development, testing, and small-scale Django projects.
SQLite is a self-contained, serverless, zero-configuration, transactional SQL database engine. It's embedded directly into the application, meaning it doesn't require a separate server process to operate. This makes it a lightweight and convenient choice for development, testing, and small-scale Django projects.
Visit the following resources to learn more:
- [@official@SQLite notes](https://docs.djangoproject.com/en/6.0/ref/databases/#sqlite-notes)
- [@article@The definitive guide to using Django with SQLite in production](https://alldjango.com/articles/definitive-guide-to-using-django-sqlite-in-production)
- [@article@“Using SQLite as a Database Backend in Django Projects” ||Code with Bushra](https://medium.com/@codewithbushra/using-sqlite-as-a-database-backend-in-django-projects-code-with-bushra-d23e3100686e)
- [@video@Django Tutorial - SQLite3 DataBase Tutorial](https://www.youtube.com/watch?v=UxTwFMZ4r5k)
- [@video@Django Part 3: Sqlite3 Database and Migrations](https://www.youtube.com/watch?v=RzkVbz7Ie44)

View File

@@ -1,3 +1,8 @@
# Static Files
Within a Django project, the `static` folder is where you store static files like CSS stylesheets, JavaScript files, images, and fonts. These files are essential for styling and adding interactivity to your web application's user interface. Django needs to know where to find these files to serve them correctly to the browser, and the `static` folder, usually located within each app directory, provides a standardized location for this purpose.
Within a Django project, the `static` folder is where you store static files like CSS stylesheets, JavaScript files, images, and fonts. These files are essential for styling and adding interactivity to your web application's user interface. Django needs to know where to find these files to serve them correctly to the browser, and the `static` folder, usually located within each app directory, provides a standardized location for this purpose.
Visit the following resources to learn more:
- [@official@How to manage static files (e.g. images, JavaScript, CSS)](https://docs.djangoproject.com/en/6.0/howto/static-files/)
- [@article@Working with Static and Media Files in Django](https://testdriven.io/blog/django-static-files/)

View File

@@ -1,3 +1,12 @@
# Tags & Custom Tags
Tags are control structures that Django's template engine uses to perform actions like looping, variable assignment, or conditional logic within templates. Custom tags allow developers to extend the template language by defining their own tags to perform specific tasks or render complex data in a reusable way.
Tags are control structures that Django's template engine uses to perform actions like looping, variable assignment, or conditional logic within templates. Custom tags allow developers to extend the template language by defining their own tags to perform specific tasks or render complex data in a reusable way.
Visit the following resources to learn more:
- [@official@Built-in template tags and filters](https://docs.djangoproject.com/en/6.0/ref/templates/builtins/)
- [@official@How to create custom template tags and filters](https://docs.djangoproject.com/en/6.0/howto/custom-template-tags/)
- [@article@Django Templates: Implementing Custom Tags and Filters](https://realpython.com/django-template-custom-tags-filters/)
- [@article@Understanding and Implementing Custom Template Tags in Django](https://dev.to/3bdelrahman/understanding-and-implementing-custom-template-tags-in-django-5cao)
- [@video@Django Tutorial #10 - Template Tags](https://www.youtube.com/watch?v=RCE3VUpzGw0)
- [@video@Python Django template tags, filters and custom template tags](https://www.youtube.com/watch?v=rs_mR-b9xys)

View File

@@ -1,3 +1,10 @@
# Template Inheritance
Template inheritance in Django allows you to build a base "skeleton" template that contains all the common elements of your site (like the header, footer, and navigation). Child templates can then extend this base template and override specific blocks of content, filling in the unique parts for each page while reusing the common structure. This promotes code reusability and maintainability by avoiding repetition across your website's templates.
Template inheritance in Django allows you to build a base "skeleton" template that contains all the common elements of your site (like the header, footer, and navigation). Child templates can then extend this base template and override specific blocks of content, filling in the unique parts for each page while reusing the common structure. This promotes code reusability and maintainability by avoiding repetition across your website's templates.
Visit the following resources to learn more:
- [@official@Template Inheritance](https://docs.djangoproject.com/en/6.0/ref/templates/language/#id1)
- [@article@Understanding Django template inheritance](https://dev.to/doridoro/understanding-django-template-inheritance-d8c)
- [@article@extends Template Tag](https://www.w3schools.com/django/ref_tags_extends.php)
- [@video@Django Template Inheritance Explained](https://www.youtube.com/watch?v=mxbzt7wodAs)

View File

@@ -1,3 +1,8 @@
# Templates
The `templates` folder in a Django project is where you store your HTML files. These HTML files define the structure and content of your web pages. Django uses a template engine to dynamically insert data from your Python code into these HTML files before sending them to the user's browser. This allows you to create dynamic and personalized web pages.
The `templates` folder in a Django project is where you store your HTML files. These HTML files define the structure and content of your web pages. Django uses a template engine to dynamically insert data from your Python code into these HTML files before sending them to the user's browser. This allows you to create dynamic and personalized web pages.
Visit the following resources to learn more:
- [@official@Templates](https://docs.djangoproject.com/en/6.0/topics/templates/)
- [@article@The Ultimate Guide to Django Templates](https://blog.jetbrains.com/pycharm/2025/02/the-ultimate-guide-to-django-templates/)

View File

@@ -1,3 +1,11 @@
# Templates
Templates are text files that separate the presentation of your application from its Python code. They contain placeholders (variables) and logic (template tags) that are evaluated when the template is rendered, dynamically generating HTML or other text-based formats. This allows you to create dynamic web pages by inserting data from your Django application into a predefined structure.
Templates are text files that separate the presentation of your application from its Python code. They contain placeholders (variables) and logic (template tags) that are evaluated when the template is rendered, dynamically generating HTML or other text-based formats. This allows you to create dynamic web pages by inserting data from your Django application into a predefined structure.
Visit the following resources to learn more:
- [@official@Templates](https://docs.djangoproject.com/en/6.0/topics/templates/)
- [@article@The Ultimate Guide to Django Templates](https://blog.jetbrains.com/pycharm/2025/02/the-ultimate-guide-to-django-templates/)
- [@article@Django Templates](https://www.w3schools.com/django/django_templates.php)
- [@video@Python Django Tutorial: Full-Featured Web App Part 3 - Templates](https://www.youtube.com/watch?v=qDwdMDQ8oX4)
- [@video@Django Tutorial - Templates & Custom HTML](https://www.youtube.com/watch?v=b0CgA_Ap_Mc)

View File

@@ -1,3 +1,8 @@
# tests.py
`tests.py` is a Python file within a Django app's directory that is dedicated to containing tests for that specific app. It allows developers to write and execute automated tests to ensure the app's functionality works as expected, covering various aspects like models, views, and forms. These tests help prevent bugs, ensure code quality, and facilitate easier refactoring and maintenance.
`tests.py` is a Python file within a Django app's directory that is dedicated to containing tests for that specific app. It allows developers to write and execute automated tests to ensure the app's functionality works as expected, covering various aspects like models, views, and forms. These tests help prevent bugs, ensure code quality, and facilitate easier refactoring and maintenance.
Visit the following resources to learn more:
- [@official@Writing and running tests](https://docs.djangoproject.com/en/6.0/topics/testing/overview/)
- [@video@Testing in Django Tutorial #4 - Django Testing Basics](https://www.youtube.com/watch?v=QklKI2etw30)

View File

@@ -1 +1,9 @@
# The MVC Model
# The MVC Model
The Model-View-Controller (MVC) architectural pattern separates an application into three interconnected parts. The Model manages data and business logic, the View displays data to the user, and the Controller handles user input and updates the Model. Django uses a slightly modified version called Model-Template-View (MTV), where the Template is the presentation layer (like the View in MVC), and the View handles the logic of what data to display (like the Controller in MVC). Django's framework structure naturally encourages this separation of concerns, making it easier to develop and maintain complex web applications.
Visit the following resources to learn more:
- [@article@MVC Architecture Explained: Model, View, Controller](https://www.codecademy.com/article/mvc-architecture-model-view-controller)
- [@article@MVC](https://developer.mozilla.org/en-US/docs/Glossary/MVC)
- [@video@MVC Explained in 4 Minutes](https://www.youtube.com/watch?v=DUg2SWWK18I)

View File

@@ -1,3 +1,10 @@
# UpdateView
UpdateView is a class-based view in Django that simplifies the process of creating a view to handle updating an existing model instance. It provides a pre-built structure for displaying a form populated with the instance's data, processing the form submission, validating the data, and saving the updated instance to the database. This reduces the amount of boilerplate code needed for common update operations.
UpdateView is a class-based view in Django that simplifies the process of creating a view to handle updating an existing model instance. It provides a pre-built structure for displaying a form populated with the instance's data, processing the form submission, validating the data, and saving the updated instance to the database. This reduces the amount of boilerplate code needed for common update operations.
Visit the following resources to learn more:
- [@official@UpdateView](https://docs.djangoproject.com/en/6.0/ref/class-based-views/generic-editing/#django.views.generic.edit.UpdateView)
- [@article@A Brief Look at Djangos UpdateView](https://medium.com/@zarker24/a-brief-look-at-djangos-updateview-8a732d5d2c5b)
- [@video@Learn Django Class Based Views - UpdateView - Theory and Examples](https://www.youtube.com/watch?v=EUUjJdw3EBM)
- [@article@Django Tutorial for Beginners - 32 - UpdateView and DeleteView](https://www.youtube.com/watch?v=5Ez2NXOX9zY)

View File

@@ -1,3 +1,11 @@
# URL patterns
URL patterns in Django define how URLs (web addresses) are mapped to specific views (functions that handle requests). They act like a directory, telling Django which view to execute when a user visits a particular URL. Each pattern consists of a regular expression that matches a URL and a corresponding view function. When a URL matches a pattern, Django calls the associated view, passing the request object and any captured parameters from the URL.
URL patterns in Django define how URLs (web addresses) are mapped to specific views (functions that handle requests). They act like a directory, telling Django which view to execute when a user visits a particular URL. Each pattern consists of a regular expression that matches a URL and a corresponding view function. When a URL matches a pattern, Django calls the associated view, passing the request object and any captured parameters from the URL.
Visit the following resources to learn more:
- [@official@URL dispatcher](https://docs.djangoproject.com/en/6.0/topics/http/urls/)
- [@article@Django URLs](https://tutorial.djangogirls.org/en/django_urls/)
- [@article@Understanding Django URL patterns](https://www.hostinger.com/in/tutorials/django-url-patterns)
- [@video@Django Full Course - 9.0 - URL dispatcher. Basics, converters, extra parameters, include](https://www.youtube.com/watch?v=BU12twkMgEg)
- [@video@Django Tutorial for Beginners 3 - URL dispatcher | Requests and Responses](https://www.youtube.com/watch?v=Y82NaZ2VZjE)

View File

@@ -1,3 +1,8 @@
# urls.py in Django Apps
In Django, the `urls.py` file within an app is responsible for defining the URL patterns for that specific app. It acts as a table of contents, mapping URL paths to specific views (functions or classes) that handle the corresponding requests. This file essentially tells Django what code to execute when a user visits a particular URL within the app's scope.
In Django, the `urls.py` file within an app is responsible for defining the URL patterns for that specific app. It acts as a table of contents, mapping URL paths to specific views (functions or classes) that handle the corresponding requests. This file essentially tells Django what code to execute when a user visits a particular URL within the app's scope.
Visit the following resources to learn more:
- [@article@Part-2: Migrations Files in Django Framework](https://medium.com/django-unleashed/django-project-structure-a-comprehensive-guide-4b2ddbf2b6b8)
- [@video@The Structure of a Django Application](https://www.youtube.com/watch?v=jmX27FrCqqs)

View File

@@ -1,3 +1,8 @@
# URL Configuration in Django
In a Django project, `urls.py` files are responsible for mapping URL patterns to specific views. They act as a table of contents for your website, telling Django which view function to execute when a user visits a particular URL. Essentially, they define the structure of your website's addressable locations and how Django handles requests to those locations.
In a Django project, `urls.py` files are responsible for mapping URL patterns to specific views. They act as a table of contents for your website, telling Django which view function to execute when a user visits a particular URL. Essentially, they define the structure of your website's addressable locations and how Django handles requests to those locations.
Visit the following resources to learn more:
- [@article@Django URLs](https://www.w3schools.com/django/django_urls.php)
- [@article@Django URLs](https://tutorial.djangogirls.org/en/django_urls/)

View File

@@ -1,3 +1,9 @@
# Variables in Django Templates
Variables in Django templates are placeholders that get replaced with actual values when the template is rendered. They allow you to dynamically display data from your Django views within your HTML templates. These variables are enclosed in double curly braces `{{ variable_name }}` and can represent data of various types, such as strings, numbers, lists, or even objects.
Variables in Django templates are placeholders that get replaced with actual values when the template is rendered. They allow you to dynamically display data from your Django views within your HTML templates. These variables are enclosed in double curly braces `{{ variable_name }}` and can represent data of various types, such as strings, numbers, lists, or even objects.
Visit the following resources to learn more:
- [@official@Variables](https://docs.djangoproject.com/en/6.0/ref/templates/language/#variables)
- [@article@Django Template Variables](https://www.w3schools.com/django/django_template_variables.php)
- [@video@Passing Variables to a Template with Django](https://www.youtube.com/watch?v=wkTE2QvzSmc)

View File

@@ -1,3 +1,10 @@
# Views
Views are functions or classes in Django that take a web request and return a web response. They act as the intermediary between the model (data) and the template (presentation), processing user requests, retrieving data from the database, and rendering the appropriate template to display the information to the user. Essentially, a view determines what content is shown to the user when they visit a specific URL.
Views are functions or classes in Django that take a web request and return a web response. They act as the intermediary between the model (data) and the template (presentation), processing user requests, retrieving data from the database, and rendering the appropriate template to display the information to the user. Essentially, a view determines what content is shown to the user when they visit a specific URL.
Visit the following resources to learn more:
- [@official@Views](https://docs.djangoproject.com/en/6.0/topics/http/views/)
- [@article@Django Views](https://www.w3schools.com/django/django_views.php)
- [@article@Django Views — The Right Way¶](https://spookylukey.github.io/django-views-the-right-way/)
- [@video@Django Tutorial #3 - URLs and Views](https://www.youtube.com/watch?v=TblSa29DX6I)

View File

@@ -1,3 +1,9 @@
# Views
`views.py` is a Python file in a Django app that contains the logic for handling web requests and returning responses. It defines functions or classes, known as "views," that receive HTTP requests, process data (often interacting with models), and render templates to generate HTML responses that are sent back to the user's browser. Essentially, it acts as the intermediary between the user's request and the data/templates needed to fulfill that request.
`views.py` is a Python file in a Django app that contains the logic for handling web requests and returning responses. It defines functions or classes, known as "views," that receive HTTP requests, process data (often interacting with models), and render templates to generate HTML responses that are sent back to the user's browser. Essentially, it acts as the intermediary between the user's request and the data/templates needed to fulfill that request.
Visit the following resources to learn more:
- [@official@Views](https://docs.djangoproject.com/en/6.0/topics/http/views/)
- [@article@Django Views](https://www.w3schools.com/django/django_views.php)
- [@article@Django Views — The Right Way](https://spookylukey.github.io/django-views-the-right-way/index.html)

View File

@@ -1,3 +1,10 @@
# Virtual Environments
Virtual environments are isolated spaces on your computer that contain specific versions of Python and its packages. This allows you to manage dependencies for different projects separately, preventing conflicts that can arise when projects require different versions of the same library. By creating a virtual environment for each Django project, you ensure that each project has its own set of dependencies, making your projects more organized and reproducible.
Virtual environments are isolated spaces on your computer that contain specific versions of Python and its packages. This allows you to manage dependencies for different projects separately, preventing conflicts that can arise when projects require different versions of the same library. By creating a virtual environment for each Django project, you ensure that each project has its own set of dependencies, making your projects more organized and reproducible.
Visit the following resources to learn more:
- [@article@How to Activate Your Django Virtual Environment](https://www.freecodecamp.org/news/how-to-activate-your-django-virtual-environment/)
- [@article@Django - Create Virtual Environment](https://www.w3schools.com/django/django_create_virtual_environment.php)
- [@article@Setting up a Django development environment](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Server-side/Django/development_environment)
- [@video@How to Install Django in Virtual Environment in VSCode (2024)](https://www.youtube.com/watch?v=EjIoERmeVE8)

View File

@@ -1,3 +1,9 @@
# Web Frameworks
Web frameworks provide a structure and set of tools to streamline the development of web applications. They handle common tasks like routing URLs, managing sessions, interacting with databases, and ensuring security, allowing developers to focus on the unique features of their application rather than reinventing the wheel. This leads to faster development, more maintainable code, and improved security practices.
Web frameworks provide a structure and set of tools to streamline the development of web applications. They handle common tasks like routing URLs, managing sessions, interacting with databases, and ensuring security, allowing developers to focus on the unique features of their application rather than reinventing the wheel. This leads to faster development, more maintainable code, and improved security practices.
Visit the following resources to learn more:
- [@article@Web Frameworks: All You Should Know About](https://www.browserstack.com/guide/web-development-frameworks)
- [@article@What is a web development framework (WDF)?](https://www.techtarget.com/searchcontentmanagement/definition/web-development-framework-WDF)
- [@video@hat Is a Framework in Programming? | Why Is It Useful?](https://www.youtube.com/watch?v=BfhSoFARn6w)