- Install
https://docs.djangoproject.com/en/4.0/intro/tutorial01/
django-admin startproject nestu
- django-admin is Django’s command-line utility for administrative tasks
https://docs.djangoproject.com/en/4.0/ref/django-admin/
In addition, manage.py is automatically created in each Django project. It does the same thing as django-admin but also sets the DJANGO_SETTINGS_MODULE environment variable so that it points to your project’s settings.py file.
-
Structure
nestu
manage.py - https://docs.djangoproject.com/en/4.0/ref/django-admin/ A command-line utility that lets you interact with this Django project in various ways.
nestu/ - Actual Python package for your project.
init.py
settings.py - Settings/configuration for this Django project.
urls.py - The URL declarations for this Django project; a “table of contents” of your Django-powered site.
asgi.py - An entry-point for ASGI-compatible web servers to serve your project. See How to deploy with ASGI for more details.
wsgi.py - An entry-point for WSGI-compatible web servers to serve your project. See How to deploy with WSGI for more details. -
MVC / MTV https://iq.opengenus.org/model-view-controller-django/
- VC is a design pattern popularly used to create web applications that consist of 3 components namely Model, View, and Controller.
- The Model manages the data-logic, View manages the user interface and the Controller interacts with the user and controls Model and View.
- The concept of MVC could be applied differently in different frameworks.
- MVC -> MTV is used in Django:
- Views = Templates(T)
- Controller = framework + Views(V).