EIEIOTECHNOVATION
← Training programmes

EIEIO / PROGRAMMING & DEVELOPMENT

Python and Django Programming

Course outline

5 days

Duration

5 days

Objective

This course will enable students to develop full-stack web sites based on content stored in an RDMS, use python data types appropriately, Define data models, Understand the architecture of a Django-based web site, create Django templates for easy-to-modify views, Map views to URLs, take advantage of the built-in Admin interface and provide HTML form processing.

Prerequisite

All students should have a working knowledge of HTML5 and CSS.

Module 2: The Python Environment

Starting Python

Using the interpreter

Running a Python script

Python scripts on Unix/Windows

Editors and IDEs

Module 3: Getting Started

Using variables

Built in functions

Strings

Numbers

Converting among types

Writing to the screen

Command line parameters

Module 4: Flow Control

About flow control

White space

Conditional expressions

Relational and Boolean operators

While loops

Alternate loop exits

Module 5: Lists and Tuples

About sequences

Lists and list methods

Tuples

Indexing and slicing

Iterating through a sequence

Sequence functions, keywords, and operators

List comprehensions

Nested sequences

Module 6: Working with Files

File overview

The with statement

Opening a text file

Reading a text file

Writing to a text file

Raw (binary) data

Module 7: Dictionaries and Sets

About dictionaries

Creating dictionaries

Iterating through a dictionary

About sets

Creating sets

Working with sets

Module 8: Functions

About sequences

Function parameters

Global variables

Global scope

Returning values

Sorting data

Module 9: Errors and Exception Handling

Syntax errors

Exceptions

Using try/catch/else/finally

Handling multiple exceptions

Ignoring exceptions

Module 10: Using Modules

The import statement

Module search path

Zipped libraries

Creating Modules

Function and Module aliases

Module 11: Classes

About o-o programming

Defining classes

Constructors

Instance methods and data

Class/static methods and data

Inheritance

Module 12: Django Architecture

Sites and apps

Shared configuration

Minimal Django layout

Builtin flexibility

Module 13: Configuring a Project

Executing manage.py

Starting the project

Database setup

The development server

Module 14: Adding an Application

Generate the application files

Defining models

Related objects

SQL Migration

App configuration

Accessing models

Module 15: Login for Nothing and Admin for free

Setting up the admin user

Running the admin site

Tweaking the admin interface

Changing the admin index page

Module 16: Basic Views (AKA Controllers)

What is a view

HttpResponse

URL route configuration

Shortcut: get_object_or_404()

Module 17: Basic Views (AKA Templates)

About templates

Django template syntax

Static files

Loading templates

The url tag

Shortcut: template.render()

Module 18: Querying the Models

QuerySets

Field lookups

Chaining filters

Slicing QuerySets

Related fields

Q objects

Module 19: Working with Templates

Variable lookups

Comments

Inheritance

Filters

Escaping HTML

Custom filters

Module 20: Forms

Forms overview

GET and POST

The Form class

Processing the form

Widgets

Validation

Forms in templates

Beyond the basics

Module 21: Automated Testing

Why create tests?

When to create tests

Using Django's test framework

Using the test client

Running tests

Checking code coverage

Programme scope, delivery arrangements and suitability are confirmed during enquiry.