04-Django Basic

Models in Django

Django Models

  • A Django model is the built-in feature that Django uses to create tables, their fields, and various constraints.
  • Each model class maps to a single table in the database.
  • Django Model is a subclass of django.db.models.Model and each field of the model class represents a database field (column).
[Read More]

05-Django Basic

Django setting

Django settings

  • A Django settings file contains all the configuration of your Django installation.
  • A settings file is just a Python module with module-level variables.
# setting example
ALLOWED_HOSTS = ['www.example.com']
DEBUG = False
DEFAULT_FROM_EMAIL = 'webmaster@example.com'
[Read More]

08-Django Basic

Django Signal and its types

Django Signal

The Django Signals is a strategy to allow decoupled applications to get notified when certain events occur.

There are two key elements in the signals machinery: the senders and the receivers

As the name suggests, the sender is the one responsible to dispatch a signal, and the receiver is the one who will receive this signal and then do something.

[Read More]