10-22-2024
10-22-2024
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
2. Middleware
Configuration of middleware application, django provides
predefined middleware. Django developer can also develop user
defined middleware.
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
3. TEMPLATES
This is used for configuration of templates (HTML)
It is used to define location where templates are saved.
4. DATABASE
This variable is used for configuring DATABASE (OR) providing
database related information
Urls.py
Wsgi.py
This module is used for configuration of wsgi container or
application.
Admin.py
Models.py
This is used for defining models.
Views.py
View.py is called controller
Views.py used for defining views for web application
The job controller is receiving and processing it and generating
output.
Views are used for controlling web application by communicating
models and templates.
What is MVT?
MVT stands for Model, View, Template
MVT is architectural design pattern. A design pattern defines set
of rules and regulations for organizing programs or code.