drf request and response
drf request and response
1. Request
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
Ubuntu+Nginx+uWSGI+DJango+python3 deployment
Ubuntu+Nginx+uWSGI+DJango+python3 deployment
technological process
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 ...
Added by Exoon on Tue, 08 Mar 2022 16:43:02 +0200
1, Django - Django introduction, virtual environment configuration and Django installation
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
Some knowledge points of Django - rich text - cache - image upload - Middleware - aspect oriented programming, etc
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 = [
os.path.join(BASE_DIR,'static')
]
After that, ...
Added by GoSharks on Mon, 07 Mar 2022 15:58:46 +0200
Django project practice ---- realize the logic of sending SMS verification code and verify whether the picture verification code is correct (verification code 2 ends)
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
Django database query optimization, choices parameters (common database field design), MVC and MTV models, and many to many creation methods
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
django rest framework version, parser and source code analysis of python Django
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 ...
Added by Kano on Fri, 04 Mar 2022 20:58:08 +0200
drf serialization component
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
Realize the master-slave synchronization of mysql8 in ubuntu and mysql8 deployed by docker
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
@TOC
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
django model layer, ORM operation details, query operation, update operation, delete, F object, Q object, aggregate query, native database operation
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 ...
Added by zenag on Fri, 25 Feb 2022 03:51:35 +0200