
Explore Django, the Python web framework, as you learn core concepts from theory to practice, and build a complete blog with an administration area and deployment.
Explore Django, a batteries-included web framework for Python that provides a clear path and rules, handles server-side logic and project structure, and lets you focus on core business logic.
The course requires basic Python knowledge and basic web development understanding, including how the web works with requests and responses and front-end basics of HTML, CSS, and JavaScript.
Discover Django, the practical guide, with three pillars—foundation, advanced concepts, and a real project—covering urls, views, templates, forms, models, file uploads, sessions, admin, deployment, and PostgreSQL.
Maximize course success by watching videos in order, at your own pace, and coding along; use attachments, GitHub repositories, slides, and Discord for support.
Choose the standard, step-by-step path through the Django course to master core features. Skip ahead to the optional summary module for a quick overview if you’re short on time.
Learn how to set up Django by installing the framework, creating new projects, and exploring the default files and folder structure to get up and running quickly.
Install Python and Django to build web apps with Python, using python.org, pip, and Django-admin to verify the installation and start a new project.
Create a new django project with django-admin startproject and a chosen name, navigate with cd, and inspect the generated folder containing manage.py to set up a development environment.
Set up a productive development environment for django with Visual Studio Code, install Python extensions like Python and Pylance, and configure interpreters and formatting to follow pep8.
Analyze the created Django project, identify the roles of manage.py, settings.py, urls.py, asgi.py, and wsgi.py, and explain which files to edit or ignore as we start the development server.
Launch a local Django development server using manage.py runserver to preview your app at localhost:8000 in the Visual Studio Code terminal, while noting the SQLite3 dummy database.
Learn how Django projects use apps to organize features, create a new app with manage.py startapp, and structure project and app folders to keep code maintainable.
Explore the created Django challenges app structure, including migrations, admin.py, apps.py, models.py, tests.py, and views.py. Learn that migrations support databases later, while views.py drives user-facing logic.
Install Django and Python, create your first project, and build a monthly challenges app while learning URLs (routes), views, and how Django handles HTTP requests and responses.
Create a brand new django project named monthly_challenges and add a challenges app, using manage.py startapp, choose a Python interpreter, and set up a VS Code workspace.
Explore urls and views in django, learning how routes map urls to python functions or classes that process requests, query data, and return html responses.
Create your first Django view and url to serve a page at /challenges/january, using a view that returns an HttpResponse and wiring with app urlconfs via path and include.
Add a second Django view and URL for February, showing how to create the view in views.py, wire it in urls.py, and load the February challenge.
Learn to use Django dynamic path segments to route all /challenges/<month> requests to a single monthlychallenge view, using the month argument to return month-specific text or a 404.
Explore Django path converters to differentiate and convert dynamic url segments into strings or integers, route to the appropriate view, and handle numbers versus text for monthly challenges.
Dynamic Django views use a monthly_challenges dictionary mapping months to tasks, replacing long if blocks with lookups and using try-except to return 404 for invalid months.
Learn how to implement redirects in Django by using http response redirect, forwarding months via a dictionary, and handling invalid months with appropriate error responses.
Design dynamic redirects in django by naming urls and using reverse to build paths from dictionary-driven data with dynamic segments, avoiding hard-coded routes.
Transform plain text responses into html by using f-strings to wrap challenge text in an h1 tag, then send html back via urls and viewers, with templates coming next.
Implement a Django challenges index page by wiring urls.py, creating an index view, and dynamically generating a list of month links with reverse.
Explore how urls, or routes, map paths to views in Django, handling requests and returning responses, with dynamic segments, app and project url registration, and the reverse function.
Replace inline HTML in views with Django templates and static files. Use the Django template language to render dynamic content and apply CSS, improving structure and SEO.
Learn to organize Django templates in app folders, render them with render_to_string, and register the app to enable app_dirs for automatic template discovery.
Learn how Django renders templates, using app-specific template paths to avoid clashes, switch from render_to_string to render, and pass the request to create dynamic content later.
Learn to use the Django template language to render dynamic HTML by passing a context to render and injecting values with double curly braces.
Learn how to add month_name to the context in views.py and use month.capitalize for a capitalized value, enabling interpolation to render dynamic titles like June Challenge.
Learn how Django template filters and pipes transform output during interpolation, with the title filter capitalizing words and moving formatting logic from view to template.
Enable Django template support in Visual Studio Code by installing the Django extension from Baptiste Darthenay and configuring settings.json for improved template syntax highlighting and autocomplete in HTML files.
Learn to use Django template language tags, especially the for tag, to loop through lists in templates. Build and render a months list with template context, loops, and dynamic links.
Learn how to generate dynamic URLs in Django templates using the URL tag, replacing hard-coded paths and reverse, with positional or keyword arguments for loop-driven links.
Explore how the Django template language uses the if tag to conditionally render content based on a value, with server-side evaluation and fallback text when no challenge exists.
Learn template inheritance in Django by creating a base template with blocks for title and content, then extend it in other templates to inject page-specific content.
Master template inheritance in Django by extending base.html, defining page_title and content blocks, and inheriting from base templates to render dynamic, month-specific content.
Use django template includes to reuse header snippets across challenge and index pages, with challenges/includes/header.html enabling a shared header and dynamic navigation via the named url index.
Create a custom 404 page by adding a 404.html in templates, extend the base, and raise a 404 error to serve the page, with debug settings showing behavior.
Learn to add css as static files alongside templates, configure static assets with Django's static tag and load static, and resolve serving issues by restarting the dev server.
Set up a project-wide static folder with a global styles.css, load Google fonts such as Roboto Condensed, and configure Django via STATICFILES_DIRS to serve global static files.
Master practical css styling for a Django app by enhancing a list with shadows, borders, two-column wrapping, and hover effects, while organizing header and page styles via static assets.
Explore how Django templates render dynamic content with interpolation, tags, and template inheritance, and manage static files like CSS through proper static folders, settings, and reusable snippets.
Launch a new blog project and app in Django, apply learned features, and add URLs, views, templates, and static files to build a realistic blog step by step.
Create a new Django project named my site, add a blog app, configure VS Code and Python interpreter, and launch the development server.
Plan a Django blog app with a root page listing latest posts, a /posts page, and a /posts/<slug> detail page. Store data in memory and apply basic styling.
Define app urls with path and a slug dynamic segment, map to starting_page, posts, and post_detail views, name the routes, and include blog.urls at root for clean root navigation.
Learn how to add app-specific templates with a base layout, use blocks for title, content, and css, and render an index template in Django.
learn to create a starting page template with header navigation, three sections (welcome, latest posts, about), and connect static css (app.css, index.css) via Django's static tag in base.html.
Learn to add images as static files by placing them in the static/blog/images folder and linking with the static tag on the starting page.
Create an all posts page that lists post previews. Reuse the shared header and an include for previews, and apply a dedicated all-posts CSS via the blog templates.
Wire up site navigation by linking starting-page and all-posts pages with url tags, connect post previews to post-detail-page via a dynamic slug, and replace hard-coded data with view data.
Create a Django post-detail page by building post-detail.html, extending the base template, loading static content, and styling with post-detail.css, while rendering the title, image, and author Maximilian via slug.
Learn to replace hard-coded template data with Python data by creating a dummy posts list in views.py, including slug, image, date, title, excerpt, and content, ready to pass to templates.
Explore how to display latest posts in a Django template by sorting post data, using for loops and dot notation, building dynamic image URLs and alt text with context.
Render all posts and navigate to a single post page via slug lookup. Display the post title, author, formatted date, line-broken content, and image with alt text.
Learn how Django uses a default 404 HTML template to handle not found pages, extending the base layout with a simple title and content.
Learn how Django models enable persistent data storage, replacing in-memory data with a database to perform queries and insert, update, and delete operations using sql syntax.
Explore the three data types: temporary data, semi-persistent data, and persistent data, and learn how Django stores and retrieves them via databases.
compare SQL and NoSQL databases, explain table-based storage with schemas versus document-based collections, and show SQLite as the SQL option used with Django.
Learn how Django creates a sqlite3 database by default, compare it with MySQL for larger apps, and use Django models to work with data without writing SQL.
Explore how Django models let you define Python classes to represent data, with Django generating SQL queries behind the scenes. Create and use models to perform common operations.
Define a Django book model in models.py for a bookstore project, extending models.Model, using CharField with max_length and IntegerField, with automatic id and a books table in db.sqlite3.
Register the app in project settings to expose the model, create migrations with make migrations, and apply them with migrate to build the books table in SQLite.
Use the Django manage.py shell to instantiate the Book model, set title and rating, and save entries to the database with Django handling the SQL.
Query the Django model to fetch saved data and display it, using the All method to retrieve a query set of all books.
Update models by adding fields, validators, and methods; run makemigrations and migrate to apply changes, handle non-nullable fields with defaults or nulls, and query data using dot notation.
Understand how blank and null govern data entry in Django models, where blank allows empty values in forms (including CharFields), and null stores null for non-text fields.
Update book records in a Django database by retrieving specific entries, editing fields like author and best selling, and persisting changes with save to reflect updates.
Delete data in Django by querying the Book model for the entry, calling delete on the instance, and checking Django's response to see how many items were removed.
Learn how to create books quickly with Book.objects.create in Django, bypassing save on an instance, and query data with all, filter, and get to retrieve single records.
Learn to fetch single entries with get and multiple entries with filter, using id, title, and modifiers like lt, lte, contains, and icontains to refine Django queries.
Explore how Django's Q clause adds or conditions to queries, letting you search by rating less than three or title containing story, and combine with and when needed.
Explore Django query performance, learning how querysets defer execution, how chaining filters caches results, and how storing queries reduces database hits for efficient data access.
Create and render Django templates for a book model by building a base and list/detail HTML structure, wiring views and URLs to output all books and navigate to details.
Query book data from the Django model with Book.objects.all(), pass it to the template as books, and render each book’s title, rating, author, and is best-selling status.
wire a book detail page by rendering a template with title, author, rating, and bestseller status, and link the list to a dynamic url using the book id.
Add clickable links between list and detail views by naming urls (book-detail) and reversing them in templates and models, using get_absolute_url and the reverse function for centralized URL building.
Learn to add a slug field to a Django model and auto populate it by overriding save and slugifying the title, then run migrations and test slug-based URLs.
Update your app to use slug-based URLs by adjusting views and get_absolute_url to slug, optimize lookups with slug db_index, and compare id versus slug as a key, introducing aggregation methods.
Use Django aggregation methods on a queryset to compute the total number of books. Compute the average rating via aggregate and sort results with order by.
Explore Django models, migrations, and querying to manage data, render results in templates, use slug identifiers and get and 404 handling, and leverage the built-in admin.
Explore Django's built-in admin interface, enabling site owners to manage data with a graphical backend for models, moving away from shell-based data work.
Explore Django's built-in admin panel, accessed via /admin, for administering site data. Create a superuser with manage.py createsuperuser and log in.
Register your models with the Django admin by editing admin.py and using admin.site.register. Customize how data appears, handle required fields, and rely on auto-generated slugs for streamlined moderation.
Explore configuring Django model fields, focusing on slugs: enable blank submissions with blank=True, disable editing in admin with editable=False, and preview auto-generated slugs in the admin.
Define a book admin class in admin.py, extend admin.ModelAdmin, and register it to customize the admin form with read_only_fields and pre_populated_fields, enabling slug pre-population and robust validation.
Explore how to configure the Django admin with practical options, including list filters and list display, to tailor the admin interface for your models such as book, author, and rating.
Explore data relationships and connected models, moving from a single book model to multiple entities like authors, and learn how to manage and set up these relations with Django models.
Explore one-to-many, one-to-one, and many-to-many data relationships using author and book examples, and learn to connect multiple models in Django.
Add an author model and connect it to books with a foreign key to form a one-to-many relation, configure on delete, then run migrations while resolving existing data.
Learn to work with Django model relations by creating authors and books in code, saving to the database, and using the shell to query across models for related data.
Explore cross model queries in Django by filtering on related data, such as author__last_name, and access inverse relations with book_set or a custom related_name to query across models.
Register book and author models in the admin, implement the __str__ method and a full_name method for author display, and manage relations via the admin dropdown and add-author flow.
Learn to implement a one-to-one relationship in Django by adding an address model and linking it to an author with a one-to-one field, plus migrations and on_delete behavior.
Create and save address instances, link them to authors in a one-to-one relationship, and explore accessing related data and the admin panel in Django.
Register the address model in admin.py, customize its __str__ display and plural verbose name via a Meta class, and cover one-to-one relations in admin config.
Set up a many-to-many relation by linking books to multiple countries with a Django many-to-many field, relying on an automatic third-table mapping and no on_delete option, then migrate.
Learn to implement a many-to-many relationship between book and country models in Django using the add method, saving objects first, then querying related countries by code.
Learn how to manage many-to-many relations in the Django admin by registering models, customizing display names, and using a multi-select panel to map books to countries.
Explore how to model relations in Django, including one-to-many, one-to-one, and many-to-many, and query these models via Python, the shell, and the admin panel, and apply to a blog project.
Define blog data and model requirements, replacing static data with Django models and relationships, use the Django admin interface to manage posts, and adjust views and templates.
Plan and define post, author, and tag models for a Django blog with matching fields for title, excerpt, image, date, slug, content, and author details; establish one-to-many and many-to-many relations.
This lecture guides building the blog post model in Django, including title, excerpt, image name, date (auto now), slug (unique), and content, with planned author and tag relations.
Define an author model in Django with first name, last name, and email fields, and link posts via a foreign key with on delete set null and related_name posts.
This lecture introduces a tag model and a many-to-many relationship with posts, including a caption field, a many-to-many field on posts, migrations, and admin panel registration.
Register post, author, and tag from .models with admin.site.register in admin.py to enable editing in admin panel, then run migrations to create a super user and manage data in views.
Fix a typo in models.py, enable null on the author field, then run migrations and migrate; create a superuser, start the server, and log into the admin at localhost:8000/admin.
Add authors and posts in the Django admin, validate emails, and customize string representations. Enable multi-column layouts and filters, and auto slug population for posts and tags.
tweak the Django admin panel by configuring a post admin with list filter and list display for author, date, and tags, and enable automatic slug pre-population from the title.
Migrate front end to fetch the three most recent posts from the Post model using Django querysets ordered by date descending, with slicing, and fix image field naming to image_name.
Implement all posts and single post pages in django by fetching all posts with objects.all and ordering by date descending; use get_object_or_404 with slug for post detail.
Link the author name to a mailto email, access the author's email_address in the template, and render post tags by looping post_tags over post.tags, with basic CSS styling.
Define models for post, author, and tech with one-to-many and many-to-many relations, then manage them with the admin panel and fetch posts via views using slicing.
Explore how to create and manage user input forms for website visitors outside the admin panel, using class-based views and Django form approaches.
Begin a new Django project and a reviews app, set up templates and urls, and implement a simple view and form for on-page visitor reviews—no admin access.
Add a standard html form to reviews/review.html with a labeled text input for username and a submit button; render via Django view to show the username as a query parameter.
Explore how standard HTML forms submit data via get and post requests, including query parameters and form data in the request body, and understand CSRF errors in Python Django.
Discover how Django protects against cross-site request forgery with a dynamically generated CSRF token added to forms via a template tag and validated on the server.
Learn to handle Django form submissions by distinguishing post and get requests, extracting data from request.post, and redirecting to a thank-you page.
Learn to validate form input on the server to prevent empty or invalid submissions, using a has_error flag and re-rendered forms, and introduce Django form class for reducing repetitive validation.
Discover how Django forms render automatically from a ReviewForm in forms.py, using form.is_valid and form.cleaned_data for server-side validation and data handling.
Learn how Django forms validate input with the built-in is_valid method, render validated forms on errors, preserve user data, and customize error messages for better user experience.
Explore how to customize Django form controls by configuring labels, max length, and error messages in forms.py, showcasing server-side validation and optional vs required fields for precise template rendering.
Master customizing Django forms by rendering individual fields, placing labels, inputs, and errors in order, wrapping controls in form-control divs, and applying an invalid class when inputs are invalid.
Create static reviews/styles.css to style a Django form, applying typography, layout, colors, and button hover and focus states along with error styling.
Add more fields to a Django review form, including a review_text textarea with max_length 200 and a rating between 1 and 5, and render fields in templates with for loop.
Learn to store form data in a Django database by creating a review model with username, review_text, and rating, then migrate and save validated data.
Extend Django forms by using ModelForm to auto-infer fields from a model, link via a nested meta class, and control included fields with fields, all, or exclude.
Configure model forms by using the meta class to set labels and error messages for inferred fields, and compare customizing versus inferring the form from the model.
Use a ModelForm to save data directly to the database by calling save after validation, and optionally update an existing Review instance with the instance keyword argument.
Convert function-based views to class-based views by implementing get and post methods, then wire with as_view in urls; use built-in list, detail, and form views to reduce code.
Expose and handle forms for website visitors with Django forms and ModelForm, render HTML in templates, validate data, and save it to database, using class-based views for get and post.
Python is the most popular programming language of the world - it is versatile, easy to learn and very powerful!
But one of the primary things you can build with Python is a website! You can use Python for web development.
And to make that easier, you would typically use a framework like Django - simply because that allows you to focus on your core business logic and you don't need to re-invent the wheel and implement all the nitty-gritty technical details from scratch.
This course is about Django - the most popular Python web development framework out there!
Django covers all aspects of web development - from handling requests and responses, over rendering dynamic HTML pages with templates, all the way up to making database access and data management easy. It's all baked in and it's all covered in great detail in this course!
This course teaches Django from the ground up - you don't need to know anything about it to get started. Basic Python and web development knowledge is all you need.
We'll start at the absolute basics and understand how to create Django project, how to run them and how to add features - step by step.
In detail, this course covers:
Installing Django
Creating and understanding Django projects
Understanding URLs, views, requests and responses
Working with templates and static files like CSS and images
Working with data and models
Connecting data with relationships (one-to-many, one-to-one, many-to-many)
Querying data with Django's powerful model solution
Adding administration panels to your projects
Handling user input with forms - manually and with Django's built-in form support
Advanced features like class-based views (and when to use them)
Dealing with file uploads and how to serve uploaded files
Working with sessions
In-depth deployment instructions and examples
Different ways of deploying and serving static files and user uploads
And much more!
All those concepts are taught in great depth and backed up by a complete example course project where we build a "Blog website" from the ground up.
Therefore, you'll learn all the important concepts and the theory and you're also going to be able to see it applied to a real project.
Hence, once you completed the course, you'll have a very solid understanding of Django and you'll be able to dive into your own Django projects!