PageView

Stories about Python, Django and Web Development

Django Tips #22 Designing Better Models

Django Tips #22 Designing Better Models

In this post, I will share some tips to help you improve the design of your Django Models. Many of those tips are related to naming conventions, which can improve a lot the readability of your code.

Read more



How to Use RESTful APIs with Django

How to Use RESTful APIs with Django

First, let’s get those terms out of our way. The REST acronym stands for Representational State Transfer, which is an architectural design. Usually when we use the term RESTful, we are referring to an application that implements the REST architectural design. API stands for Application Programming Interface, which is a software application that we interact programmatically, instead of using a graphical interface. In other words, we interact with it at a lower level at the source code, writing functions and routines.

Read more



How to Implement Dependent/Chained Dropdown List with Django

How to Implement Dependent/Chained Dropdown List with Django

Dependent or chained dropdown list is a special field that relies on a previously selected field so to display a list of filtered options. A common use case is on the selection of state/province and cities, where you first pick the state, and then based on the state, the application displays a list of cities located in the state.

Read more



How to Implement Multiple User Types with Django

How to Implement Multiple User Types with Django

This is a very common problem many developers face in the early stages of the development of a new project, and it’s also a question I get asked a lot. So, I thought about sharing my experience with previous Django projects on how to handle multiple user types.

Read more



A Complete Beginner's Guide to Django - Part 7

A Complete Beginner's Guide to Django - Part 7
Welcome to the last part of our tutorial series! In this tutorial, we are going to deploy our Django application to a production server. We are also going to configure an Email service and HTTPS certificates for our servers.

Read more



A Complete Beginner's Guide to Django - Part 6

A Complete Beginner's Guide to Django - Part 6
Welcome to the sixth part of the tutorial series! In this tutorial, we are going to explore in great detail the Class-Based Views. We are also going to refactor some of the existing views so to take advantage of the built-in Generic Class-Based Views.

Read more



A Complete Beginner's Guide to Django - Part 5

A Complete Beginner's Guide to Django - Part 5
In this tutorial, we are going to learn more about protecting views against unauthorized users and how to access the authenticated user in the views and forms. We are also going to implement the topic posts listing view and the reply view. Finally, we are going to explore some features of Django ORM and have a brief introduction to migrations.

Read more



How to Create Django Data Migrations

How to Create Django Data Migrations

Data Migration is a very convenient way to change the data in the database in conjunction with changes in the schema. They work like a regular schema migration. Django keep track of dependencies, order of execution and if the application already applied a given data migration or not.

Read more



A Complete Beginner's Guide to Django - Part 4

A Complete Beginner's Guide to Django - Part 4
This tutorial is going to be all about Django's authentication system. We are going to implement the whole thing, registration, login, logout, password reset, and password change.

Read more



A Complete Beginner's Guide to Django - Part 3

A Complete Beginner's Guide to Django - Part 3
In this tutorial we are going to dive deep into two fundamental concepts, URLs and Forms. In the process we are going to explore many other concepts like creating reusable templates and installing third party libraries. We are also going to write plenty of unit tests.

Read more