Django template development & rewriting & using bootstrap
Django template development & rewriting & using bootstrap
This paper uses Django's own template system
base.html
Django's template system is inseparable from base Html is a template file, which is equivalent to a large framework. It is spliced through various block blocks, which is similar to vue's template.
You can do it at ba ...
Added by hatching on Wed, 23 Feb 2022 04:06:56 +0200
Notes on Chapter 5 of Tango With Jango2 -- Model & DB
Django uses object relational mapper (ORM) ¹ To access the data stored in the database
In essence, the data stored in the database table is encapsulated by the Django model. A model is a python object that describes database table data. Django provides some methods that allow you to manipulate data through corresponding Python model objec ...
Added by shashiku on Tue, 22 Feb 2022 22:31:24 +0200
Django template language
cycle
Each time this tag is encountered, a parameter is generated. The first encounter generates the first parameter, the second encounter generates the second parameter, and so on. Once all parameters are exhausted, the tag loops to the first parameter and generates it again.
def variable_dict(request):
var_dict = {'var1': ['var0', 'var1 ...
Added by ChaosKnight on Sun, 20 Feb 2022 12:49:28 +0200
Django model and background
Brief introduction of Django model and background
Author: once day date: February 13, 2022
This document is to summarize the relevant contents. Scattered knowledge is difficult to remember and learn.
This document is based on windows platform.
1. Database configuration
stay First met Django As mentioned in the article, Django is based on M ...
Added by d0rr on Sun, 13 Feb 2022 08:14:52 +0200
Django learning 3 based on pycham -- ORM
What is ORM?
ORM, Object Relational Mapping (ORM) pattern, is a technology to solve the mismatch between object-oriented and relational databases. In other words, ORM acts as a translation function.
Install third-party libraries
pip install mysqlclient
Create database
What exactly can ORM help us do?
Create, delete and modify tabl ...
Added by souravsasi123 on Sat, 12 Feb 2022 18:51:00 +0200
css simple knowledge
CSS style sheet
1, Overview
1. What is CSS?
Cascading style sheets, customizing the display style of html elements and beautifying the page are very important for the construction of front-end pages
2. Why use CSS
(1) CSS refers to cascading style sheets (2) Styles define how HTML elements are displayed (3) Styles are usually stored in sty ...
Added by lee2732 on Sat, 12 Feb 2022 03:30:55 +0200
Django (6. CreateView of common views)
Before Django (3. ListView view of common views) In, we mentioned that there are five common views. To add such an operation, we will use the CreateView view. The table also mentioned that using CreateView requires both Model and Form. Let's take a look at Form first.
There are two main types of forms:
Form (data should be verified manually, ...
Added by Qbasicboy on Sat, 05 Feb 2022 08:19:18 +0200
Django (5.Model and QuerySet, database operation)
Database (warehouse)Model (warehouse design drawing)
fields: CharField,IntegerField,FloatField,DateTimeField, OneToOneField,ManyToManyField,Foreignkey
fields parameter: max_length,choices
Instance (goods)QuerySet query set (package) List like objects Indexable, sliced, in (instance in queryset)
Database connection
Dja ...
Added by ratebuster on Thu, 03 Feb 2022 12:08:36 +0200
Django framework learning -- 8 -- cache & Middleware
Key points of this article:
1. How to respond faster through caching?
2. What is middleware?
3. How to realize the paging function of the website?
4. Generate csv fil ...
Added by thebluebus on Thu, 03 Feb 2022 05:56:07 +0200
Django+Vue realizes the operation of adding, deleting, modifying and querying
1, Static routing
urlpatterns attribute
urlpatterns is a global variable in the routing file, which is used to store the mapping relationship between routing and view functions
The request URL initiated by the user will first enter the URLs under the main control directory Py file
First find URLs The urlpatterns global variable under py, wh ...
Added by pornophobic on Thu, 03 Feb 2022 03:58:28 +0200