Django - Model Layer (Single Table Operation)
Catalog
1.ORM introduction
2. Single Form Operation
2.1 create table
2.2 Add Table Records
2.3 Query Table Records
2.4 Delete table records
2.5 modification form record
1.ORM introduction
An important part of MVC or MVC framework is ORM, which realizes the decoupl ...
Posted by kwilameiya on Fri, 27 Sep 2019 10:50:55 +0200
Use of Django Framework Caching and Paging
cache
What is caching?
Caching is a kind of media that can read data faster. It also refers to other storage methods that can speed up data reading. Usually used to store temporary data, the common medium is fast memory.
Why use caching?
View r ...
Posted by ThatGuyBob on Tue, 17 Sep 2019 14:00:46 +0200
Django Project: 3. User Registration Function
Supplementary Knowledge Points for the Content of this Chapter
Good order for importing libraries:
1. System libraries 2.django libraries 3. Self-defined libraries (third-party libraries)
redis caches database data call fast, but it is not conducive to long-term storage.
mysql is used for long-term storage, but calls are slow.
The sessi ...
Posted by and1c on Mon, 16 Sep 2019 15:46:14 +0200
Django + Gunicorn + Nginx Deployment Path
Preface
Recently, I have successfully migrated my personal website from Flask to Django. It was about four years ago that I first contacted Django. I remember that routing configuration in Django was done using regularity at that time, but I was particularly tired of it, so I decided to drop the hole.Then at the beginning of this year, I wrote ...
Posted by wyvern on Wed, 11 Sep 2019 03:46:52 +0200
Some of the wonders of python development
This article serves as a record of some of the tricks encountered in the use of python, some of which are written by myself, some of which are built-in functions of python, and some of which are taken from the Internet. In this record, only for backu ...
Posted by straycat on Tue, 10 Sep 2019 15:07:20 +0200
Django Framework 2: urls.py Routing Settings
The routing system is to match the received requests according to the website address and specify the functions or classes to process the requests.
Routing system classification:
Web framework routing system is generally divided into two categories, FBV, CBV, Django both support, but some frameworks only support one.
FBV (Function Base View): ...
Posted by shamilton on Sat, 07 Sep 2019 12:38:07 +0200
Python Quickly Develops Distributed Search Engine Scrapy Speech - Writes spiders crawler file loops to capture content
Write spiders crawler files to cycle through the contents
Request() method, which adds the specified url address to the downloader download page with two required parameters,Parameters: url='url'callback=page handleryield Request() is required for use
The parse.urljoin() method, which is under the urllib library, is an automatic url splicin ...
Posted by dietkinnie on Thu, 05 Sep 2019 02:55:50 +0200
Django Intermediate Key and Context Processor
Middleware and Context Processor
Django Middleware
It is a lightweight, low-level "plug-in" system that can intervene in Django's request and response processing and modify Django's input or output.
Activating Middleware
It needs to b ...
Posted by Satabi2 on Wed, 04 Sep 2019 14:48:06 +0200
Django Template Language-1: A complete data acquisition example
1. Django form request:
The default when opening is a GET request to get the contents of the form.
Point submission occurs when a POST request submits the contents of the form.
Write the Get Form Content based on the above differences:
from django.shortcuts import HttpResponse
from django.shortcuts import render, redirect
def login(request):
...
Posted by cavolks on Tue, 03 Sep 2019 19:16:37 +0200
Django uses csv, HttpResponse, Streaming HttpResponse to export
First: Preface
In django, how to download csv files of website data to users? We have learned httpResponse before and used it together.
Case 1 - Small File Export
1. Case descriptionWe provide the information in the database directly to the client to download.
Add database model and insert data;
New view, using HttpResponse, csv module to ret ...
Posted by dennisflash on Sun, 01 Sep 2019 17:09:19 +0200