Overview

This submodule will help you learn how to work with most popular web framework for Python - Django. We will explore a variety of concepts including using Model-View-Controller pattern, server-side programming, idea of using web frameworks and we will start our journey with Django.

Objectives

By the end of this submodule, you should be able to:

  • Understand the concept of MVC pattern
  • Understand what web server is and how it is related to server-side programming
  • Use the Django web framework to start creating projects and applications

Material and Resources

Resources

Here are some useful resources for you to explore:

Exercises

  1. Basic project setup and 'Hello world' in Django

Time: 20 minutes

Level of Difficult: Low

Description: There are few sub-tasks to complete

Link: https://github.com/zacniewski/Python-Basics-Django-framework/tree/main/django-framework-exercises/start-new-project

  1. Adding new app, URL configuration and routing

Time: 40 minutes

Level of Difficult: medium

Description: There are few sub-tasks to complete

Link: https://github.com/zacniewski/Python-Basics-Django-framework/tree/main/django-framework-exercises/urls-and-routing

  1. Views and templating

Time: 60 minutes

Level of Difficult: medium

Link: https://github.com/zacniewski/Python-Basics-Django-framework/tree/main/django-framework-exercises/views-and-templating

  1. Sessions and cookies

Time: 40 minutes

Level of Difficult: medium

Link: https://github.com/zacniewski/Python-Basics-Django-framework/tree/main/django-framework-exercises/sessions-and-cookies

  1. Testing in Django

Time: 30 minutes

Level of Difficult: medium

Link: https://github.com/zacniewski/Python-Basics-Django-framework/tree/main/django-framework-exercises/testing-in-django

  1. Django middleware

Time: 40 minutes

Level of Difficult: medium

Link: https://github.com/zacniewski/Python-Basics-Django-framework/tree/main/django-framework-exercises/django-middleware