Skip to main content
pelatihan
.org
Learn. Practice. Grow.
Category
EN
Sign in
Sign up
Menu
Django Curriculum: 11 Chapters, 56 Lessons — pelatihan.org
Home
/
Catalog
/
Django
/
Curriculum
Curriculum
Django Curriculum
Learn Django online with 56 structured lessons, code examples, and 280 quiz questions.
56 lessons
11 chapters
280 questions
Summaries and key points are free to preview. Full lessons, code examples, and quizzes require a subscription.
01
Django Tutorial
15 lessons
01
Django Home
Django is a complete Python web framework and battery-included. It provides ready-to-use features such as ORM, template systems, authentication, and automated admin. With Django,…
02
Django Intro
DjangoIntro introduces the general way Django works, from HTTP requests to user responses. You'll understand the data streams from URLs, views, templates, and then back as HTML.…
03
Django Get Started
DjangoGet Started explains the initial steps of creating Django apps from scratch. You're going to create a project, then you're going to apply it, and you're going to run your…
04
Create Virtual Environment
Virtual environments are isolated folders that store Python dependencies specific to your project. With venv, the Django package version doesn't clash between projects. It's…
05
Install Django
Once the venv is activated, Django is installed via pip. You can lock the version in the requirements.txt to make it easy to reinstall. Clean installation makes the project easy…
06
Django Create Project
The Django project is created with the startproject command that produces a folder containing manage.py and configuration modules. It contains settings.py for settings and…
07
Django Create App
Django applications are modules that can be reused for a specific feature, such as members modules. You make it with a startup and then you register it with INSTALLED_APPS. This…
08
Django Views
View is a Python function that receives a request and returns a response. Each web page in Django is generally handled by a single view. View can render templates or restore raw…
09
Django URLs
Django URLconf maps the URL pattern to a particular view through the path function. Each project has its own main urls.py, and each application can have its own urls.py. With…
10
Django Templates
Templates are HTML files that dynamically insert data from view. Django Template Language (DTL) provides variables, tags, and filters for this need. Templates make a different…
11
Django Models
The model is a Python class that represents a database table. Each model attribute becomes a column, and Django automatically adds a field id as the primary key. The model makes…
12
Django Insert Data
New data can be entered through the model object and then called save(), or using the objects.create(method). After save(), a new line is created in the associated table. This…
13
Django Update Data
To update the data, take the object from the database, change its attribute, and then call save(). Changes are only saved after the save() is called. This applies to all fields…
14
Django Delete Data
The data is deleted by calling delete() on the object that has been taken. You can also delete a lot of data through a query set. Once deleted, the row disappears permanently…
15
Django Update Model
When the model structure needs to change, you edit the field in models.py and then make a new migration. Django detects changes and generates migration files that can be applied…
02
Display Data
6 lessons
01
Prep Template and View
At this stage you set up templates and views to display the data list. View takes all the objects and sends them to the template through context. From here, users can see the…
02
Add Link to Details
Detailed pages are usually accessed via a dynamic URL such as /members/1. The id parameter is captured by a path converter and then taken from the object with objects.get(). You…
03
Add Master Template
A master template is a basic template containing a shared page frame. The other template just uses {% extends %} and fills the content blocks. This avoids repeating the same HTML…
04
Add Main Index Page
The main page is created by adding a '' blank path that dots to the view index. From this page, users can browse other parts of the site. It becomes the starting point for your…
05
Django 404 Template
The 404 page can be customized by adding a template 404.html. Django will automatically wear it when the page is not found. That way the error display stays consistent with your…
06
Add Test View
Test pages are useful to ensure routing and view work before a project develops. You create a small view, map the URL, and then open it in the browser. It's a quick way to verify…
03
Admin
7 lessons
01
Django Admin
Django provides a ready-made admin site to manage data without writing its own interface. You access it through an admin after you create a superuser. The model listed will…
02
Create User
New users can be created via the admin page, that is, by opening Add user and filling in the username and password. You can also make it through createsuperuser for a…
03
Include Models
For the Member model to appear in the admin, list it in the file admin.py belonging to the application. After that, the data can be viewed and edited through the admin interface.…
04
Set List Display
With ModelAdmin, you can specify any column that appears in the admin data list. The list is set by the list_display attribute in the admin class. The display becomes more…
05
Update Members
Changing the member data in the admin is done by opening the object and then filling out the form and saving it. From here you can update one or more fields at a time. The admin…
06
Add Members
Adding members to the admin can be done by using the Add button available on the list page. You fill out an automated form of the model and save it. New data is immediately…
07
Delete Members
Deleting members in the admin is done by selecting objects and then using the Delete action. You can also delete an object by using the Delete button on the details page. The…
04
Django Syntax
6 lessons
01
Django Variables
The template variable displays data sent from the view, for example {{name}} for the object attribute. You can break through a tiered property like member.firstname}} and use a…
02
Django Tags
The template tag is written with a double square brackets containing keywords, for example {% if %} and {% for %}. The tag controls the logic of the display such as repetition…
03
Django If Else
Tag if allows templates to display content based on specific conditions. You can use else and ellipses for other branches, as well as comparison operators like == and in. It…
04
Django For Loop
Tag for performs a repetition on a list of data, for example displaying the entire member. You can also use forloop.counter for the sequence number and check the empty state with…
05
Django Comment
Comment is written with {#... #} for one-line comment or {% comment %}... {% endcomment %} for block. The comments don't follow the final HTML rendering. It helps to make notes…
06
Django Include
Tag {% include %} insert other template content into the current page, such as the navbar or footer. It breaks up a large page into small pieces that are easy to handle. Each…
05
QuerySets
4 lessons
01
QuerySet Introduction
QuerySet is a collection of object models from a database that can be filtered and sorted before evaluation. It's lazy, which means that the query is actually run again when the…
02
QuerySet Get
The get() method takes a single object that matches the criteria, usually via the primary key. If nothing matches, throw the exception DoesNotExist. Unlike filter() which returns…
03
QuerySet Filter
Filter() returns QuerySet containing certain qualifying objects, similar to the WHERE clause in SQL. You can put a few filters together for more specific conditions. The result…
04
QuerySet Order By
Order_by() sort the QuerySet results based on one or more fields. Add a minus (-) mark before the field name to sort down. The order can be combined with the previous filter.
06
Static Files
5 lessons
01
Add Static Files
Static files such as CSS, JavaScript, and images are stored in the static folder of the application. You set up the STATIC_URL and STATICFILES_DIRS so Django could find it. Then…
02
Install WhiteNoise
WhiteNoise is a library that allows Django to present static files independently without a separate server. How to install WhiteNoise and add it to MIDDLEWARE. It's practical for…
03
Collect Static Files
Collectstatic collects all the static files from all the applications into one destination folder. This command is executed with the python collectstatic. This file set is then…
04
Add Global Static Files
Global static folders allow you to share static files across applications without doubling. You add it through STATICFILES_DIRS in settings.py. Then the files from that folder…
05
Add Styles to the Project
The project style is added via the CSS file referenced from the template. You create a CSS file in a static folder and then load it with the tag {% static %}. That way the entire…
07
PostgreSQL
5 lessons
01
PostgreSQL Intro
PostgreSQL is a robust relational database management system that is popular for production. Django supports PostgreSQL through the DATABASES configuration in settings.py. Many…
02
Create AWS Account
AWS is a cloud service provider where you can run applications and databases. The first step is to create an AWS account and then select the services you need. This account…
03
Create Database in RDS
Amazon RDS allows you to create a managed PostgreSQL database without managing a physical server. You pick the engine, the size, the credentials, and then let RDS manage the…
04
Connect to Database
After RDS was created, the Django project was connected to the database by changing the DATABASES configuration in settings.py. You fill in the host, port, database name, and…
05
Add Members
Once you connect to the production database, you can add member data via an admin or script. The data will be stored in RDS, not local SQLite. Make sure the migration is done so…
08
Deploy Django
6 lessons
01
Elastic Beanstalk (EB)
Elastic Beanstalk (EB) is an AWS service that manages infrastructure for running web applications. You just upload the code, and EB sets up the server, scaling, and monitoring.…
02
Create requirements.txt
Requirements.txt lists all Python dependencies and their versions. This file is created with pip freeze and read by the deployment platform to install the package. Without it,…
03
Create django.config
The .ebextensions configuration file (e.g. python.config) gives instructions to Elastic Beanstalk during deployment. It allows you to specify setup commands, environment…
04
Create .zip File
Before uploading to EB, the project is packaged into a file .zip containing all code along with requirements.txt. Make sure the unnecessary files aren't compressed. This archive…
05
Deploy with EB
Once ready, the project is deployed to Elastic Beanstalk with eb create and eb deploy commands. EB will set up the environment, install the dependencies, and run the…
06
Update Project
Once there's a code change, you just repack and run the eb deployment to update the app on eb. EB will gradually replace the old version with the new one. This process…
09
More Django
2 lessons
01
Add Slug Field
Slug is a text-friendly version of the URL, for example the title becomes 'learning-django'. You add it as a SlugField field to the model and then fill it out. Slug is useful for…
02
Add Bootstrap 5
Bootstrap 5 adds ready-to-use UI components such as buttons, navbars, and cards. You can upload it over a CDN in the parent template and then use the classes. It speeds up the…