KEMBAR78
Database Modelling-Django Colabs | PDF
0% found this document useful (0 votes)
2 views1 page

Database Modelling-Django Colabs

The document discusses database modeling in Django, highlighting the role of models in storing data and how they map to database tables. It explains that each model is a class extending django.db.models.Model, with attributes representing database columns. Additionally, it covers the installation of Pillow for image processing and the importance of managing migrations for tracking database schema evolution.

Uploaded by

Ngaga Dancan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Database Modelling-Django Colabs

The document discusses database modeling in Django, highlighting the role of models in storing data and how they map to database tables. It explains that each model is a class extending django.db.models.Model, with attributes representing database columns. Additionally, it covers the installation of Pillow for image processing and the importance of managing migrations for tracking database schema evolution.

Uploaded by

Ngaga Dancan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Database Modelling

1. Working with Models

Storing data in a database is a common practice in most web applications. In a Django project, it
involves working with Django models. Django will turn these models into database table for us.

Model – a model contains the fields and behaviors of the data we want to store. Commonly each models
maps a database table.

Django models basics

- Each model is a class that extends django.db.models.Model


- Each model attribute represents a database column

Django.db – this module helps to define and map the characteristic of the model to the database.

Model properties/ model types

CharField – is a string for small-to-large-sized strings, max_length argument is required

2. Installing Pillow – adds image processing capabilities to our python interpreter


3. Managing Migrations – Migrations allow us to generate a database schema based on model
code. In the end, migrations allow us to have a trace of the evolution of our database schema.

You might also like