|
Introduction to Django Reja
|
bet | 3/6 | Sana | 19.11.2023 | Hajmi | 1,28 Mb. | | #101246 |
Bog'liq django 1 Жураев А, elektr1-ma\'ruza, Lagranj interpolyatsion formulasi. Nyutonning tengmas oraliqlar (1), Yeshniyazov Erkin Dasturlash, Avtomatik qayta ishga tushirish - Vikipediya., Menejment-va-strategik-rejalashtirish, 1-Laboratoriya ishi, Lecture 2, axborot xavfsizligi, amaliyot kt, 2- mavzu O‘quv amaliyot mashg‘ulotining o‘qitish texnologiyasi, 56-59, Mustaqil ta’lim uchun mavzular Sharq mutafakkirlarining pedagog, markaziy-osiyo-davlatlari-tashqi-siyosatida-mintaqaviy-hamkorlikTo see all the files and subfolders of django project, we can use tree command to view the tree structure of the application. This is a utility command, if it is not present, can be downloaded via apt-get install tree command. Running the Django Project - Django project has a built-in development server which is used to run application instantly without any external web server. It means we don't need of Apache or another web server to run the application in development mode.
- To run the application, we can use the following command.
- $ python3 manage.py runserver
Look server has started and can be accessed at localhost with port 8000. Let's access it using the browser, it looks like the below. DJANGO MODELS AND DATABASE Agenda What is Model? - A model is the single, definitive source of information about your data.
- It contains the essential fields and behaviors of the data
- you’re storing
- Generally, each model maps to a single database table.
- Each model is a Python class that subclasses django.db.models.Model.
- Each attribute of the model represents a database field.
- from django.db import models
- class Person(models.Model):
- first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30)
|
| |