Django Fundamentals

This course teaches the basics of web development with the Django framework. It will teach you everything you need to become a productive Python web developer.
Course info
Rating
(572)
Level
Intermediate
Updated
Jan 31, 2014
Duration
3h 9m
Table of contents
Introduction to Django
Installing Django
Starting a Django Project
Models
Adding a User Home Page
Forms
Making Moves
Odds and Ends
Description
Course info
Rating
(572)
Level
Intermediate
Updated
Jan 31, 2014
Duration
3h 9m
Description

Django is the most popular and most mature Python web development framework around. It makes it easier to build better Web apps more quickly and with less code. Building web sites with Django is not just smart and efficient, but fun too!

About the author
About the author

After years of working in software development, Reindert-Jan Ekker has decided to pursue another passion of his: education. He currently works as a college professor of Computer Science in the Netherlands, teaching many subjects like web development, algorithms and data structures and Scrum.

More from the author
Pandas Playbook: Visualization
Intermediate
2h 11m
Oct 9, 2018
Pandas Playbook: Manipulating Data
Intermediate
2h 15m
May 24, 2018
More courses by Reindert-Jan Ekker
Section Introduction Transcripts
Section Introduction Transcripts

Introduction to Django
Hi. This is Riendert-Jan Ekker and welcome to this course about the fundamentals of web development with Django. In this module I'll tell you a bit about what Django is and why you'd want to learn it and what you need to know to be able to follow this course. I'll also tell you what you can expect from this course.

Installing Django
Hi, this is Reindert-Jan Ekker and welcome to this module in which I'll show you how to obtain and install Django. The basic installation procedure is the same whether you are using a Mac, Linux, or Windows machine. Needless to say, you need to start with installing Python. Of course, in case you already installed Python, you may want to skip this step, but if you are running Mac OS or Linux, which have a preinstalled version of Python, you probably want to upgrade, because chances are that your OS doesn't come with the latest version of Python. Now after making sure you have the right version of Python installed, the next step is install the pip package manager. Pip will make installing Django very easy and it will also make installing third-party packages very easy. Up to here the steps for installation depended on your platform and I will show you how to do this on Windows, Mac OS and Linux, but from here, after installing pip, everything is pretty much the same regardless of your OS. So the next step is to install a tool called virtualenv. Now this tool is not strictly necessary for installing Django. You might just skip this step and go straight ahead to the installation of Django. But as we'll see later in this module, that's not really a good idea in a real development environment and that's why I'll have to complicate things a bit and show you have to install virtualenv and create a virtual environment for your first Django projects. You'll find out what that means when we get there. And finally, after all these steps we will be ready to install Django and start working on our first web application.

Starting a Django Project
Hi, I'm Reindert-Jan Ekker, and in this module we'll start a new Django project and make our first simple web application. So in this module I'm going to take you through all the steps needed to create our first real web application with Django. First we'll have to create a new project, and then we'll add a new page to that project, a Hello, World page, and to do that we need several steps. First we'll have to make a new app, which is a specific Django component I'll tell you more about, and then to that app we'll add a view and a template. And afterwards, I'm also going to show you how to add some styling and some scripting and some extra files to that project. Of course we'll also have to see how to run the application. And finally, we need to take a look at the design pattern around which Django revolves, and that's called MTV, or Model Template View. This is a Django-specific flavor of the very popular Module-View-Controller pattern, or MVC, which you may already know about.

Models
Hi, my name is Reindert-Jan Ekker and in this module we'll add some real functionality to our project. We'll make Model classes and generated database from there and see how Django makes it very easy to work with persistent data. After looking at _____templates and views, we're ready to start adding some models. We'll see how to write Model classes and define database field types, how to save your objects to the database and delete them, how to do queries on your database, and how to handle relations between objects. When we've written our models we can let Django generate the database and even have it auto-generate a user interface for editing the contents of our database.

Adding a User Home Page
Hi, I'm Reindert-Jan Ekker and in this module we're going to add a user homepage to our Django projects. So, we're going to add some user homepages and I'd like to add some content from the database to those pages so you can see how we can retrieve that data and display it using a template. We'll also need to use authentication so that the user can log in and that we can check on the home page whether he is actually logged in as a user. Furthermore, we'll need some more advanced template language. We'll need to do some logic, some _____ statements, we need to generate URLs. For example, a link to the log-in and the log-out page, and we'll also see how to do template inheritance, which is a very powerful feature that will enable us to apply styling to the whole site at once. I'll also go a bit deeper into URL mappings.

Forms
Hi, my name is Reindert-Jan Ekker and in this module we'll add some HTML forms to our application to enable user interaction. So in this module I'm going to add invitations where a user can invite another user to a new game and to do that we need to do several things. To start I'm going to add an invitation model and then we'll have to generate an HTML form from there. Then we'll see how Django validates user input from an HTML form. We'll see how to style the form. We'll see how to use the form in a view, and how to write the templates to display the form. Along the way we'll also see how to pass arguments to view methods.

Making Moves
Hi, this is Reindert-Jan Ekker and welcome to this module in which we'll add move making and finish the tictactoe module. So, we'll finish our tictactoe app and to do so we'll have to add move making to our apps functionality. We'll do this with a move form and to that form we'll add custom validation of the user input. We'll have to add a lot of logic to the application as well to do things like draw the board or decide who's move it is or won the game. While adding logic we'll learn about a Django principle called fat models. We'll also learn about some advanced template features along the way.

Odds and Ends
Hi, I'M Reindert-Jan Ekker and welcome to this module of the Django course in which I will conclude this introduction to Django with mentioning some odds and ends and with that we will come to the end of this course. By now, you know all the basics of Django. You know how to work with models, templates, and views, how to map URLs to views, and how to work with HTML forms. Now's there's three last three last things I'd like to discuss with you in this last module. First of all, I want to tell you about generic views. They are an important, although somewhat advanced advanced Django feature that'll help you keep your view code as short as possible. Secondly, I want to show you a little bit about debugging your Django code, and then I'd like to show you some pointers about everything else there is to know about developing Django applications and where to go from here.