drf request and response
The request object of the incoming view of the REST framework is no longer the default HttpRequest object of Django, but the object of the request class that extends the HttpRequest class provided by the REST framework.
The REST framework provides a Parser. After receiving the Request, it will automati ...
Added by geetakhurana on Thu, 10 Mar 2022 04:10:48 +0200
Client requests service resources
As a direct external service interface, nginx will unpack and analyze the http request sent by the client,
If it is a static file request, return the requested resource according to the static file directory configured by nginx,
If it is ...
1, Introduction to Django
1.1 introduction to Django
Django, released in 2005, is the most famous and mature network framework in the python world. A web site originally used to produce online news. Django is an open source web application framework written in python (the source code is open source and complies with BSD copyright). MVC fra ...
Added by dmeade on Mon, 07 Mar 2022 22:48:21 +0200
Static file configuration
In setting At the bottom of Py is a folder called static, which is mainly used to load some resources used in the template for global use This static file is mainly used to configure CSS, HTML, images, font files, etc
STATIC_URL = '/static/'
STATICFILES_DIRS = [
After that, ...
Added by GoSharks on Mon, 07 Mar 2022 15:58:46 +0200
To realize the function of sending SMS verification code, we need to use a third-party library. Here we use Ronglian cloud
Use Ronglian cloud to build applications
Build a new application Just check the SMS verification code After the creation is successful, click application management to view it Account ID and account Token Application ...
Added by run2web on Mon, 07 Mar 2022 15:45:22 +0200
Database query optimization
orm statement features: lazy query
If it's just writing orm Statement. If the parameters queried by the statement are not used later, then orm It will be recognized automatically and will not be executed
give an example:
res = models.Book.objects.all()
# Executing this statement alone, Django will not use the databa ...
Added by Mateobus on Sun, 06 Mar 2022 16:02:22 +0200
1, rest framework version introduction
In the previous article, we introduced three authentication functions of the rest framework, perform_ Authentication, permissions and throttles, which are inherited from the View method through APIView and reflected by the dispatch method through initialize_ The request method encapsulates a request(R ...
I Introduction to serializer
1. Serialization and deserialization in Python
Serialization: converting objects in Python to strings in XML formatDeserialization: convert a string in Python format into an object in Python
2. Function of serializer
Serialization, the serializer will convert the model object into a dictionary, and then into a j ...
Added by IanMartins on Thu, 03 Mar 2022 19:36:02 +0200
Tip: after the article is written, the directory can be generated automatically. Please refer to the help document on the right for how to generate it
Preface (MySQL version 8.0.28)
Recently, I studied mysql master-slave construction and read many tutorials. They all create mysql master and slave in the docker container, but my own ma ...
Added by dan182skater on Wed, 02 Mar 2022 16:19:48 +0200
ORM operation The basic operations include addition, deletion, modification and query, that is, crud operation. The core of ORM CRUD is the model class Manager object
Manager object Each inherits from models The model class of model will also have an objects object inherited. This object is called the manager object. The addition, deletion, mo ...