django implements foreground and background data binding by submitting form with ajax+post
The first step is to introduce jquery files, either online or offline, to add to your own staticfiles
What's demonstrated here is adding offline
<script src={% static 'js/jquery-2.1.1.min.js' %}></script>
Note that this sentence is added before the ajax jquery script you write.
Then the HTML form is as follows:
...
Posted by TraceyK on Tue, 07 Jul 2020 16:31:40 +0200
Pandas of Python data analysis: time series
CSDN Course recommendation: towards data scientist: take you to play Python data analysis, lecturer Qi Wei, CTO of Suzhou Yantu Education Technology Co., Ltd., member of the master's Steering Committee of applied statistics major of Suzhou University; published "learn python with the old: easy introduction", "learn python wit ...
Posted by thegman on Sat, 27 Jun 2020 06:52:12 +0200
How does Django use snowflake to generate a primary key instead of automatically?
Before, ID was implemented with auto increment. Now I want to use Snowflake algorithm to generate primary key. What changes should I make?
catalog
Background
Implementation plan
Scenario 1 - add primary key manually
Scenario 2 - override save() method
Scenario 3 - using pre in Django Signals_ save() ...
Posted by ivi on Wed, 17 Jun 2020 08:11:54 +0200
Using SQLAlchemy in flask
In flask, many people prefer to operate the database through SQLAlchemy. In this case, it is recommended to use package instead of module to split the data model into a separate module. Such an approach is not necessary, but more reasonable.
Flask-SQLAlchemy Extension
Because SQLAlchemy is a general database abstracti ...
Posted by rahulephp on Fri, 01 May 2020 09:57:19 +0200
Django implementation of combined search
1, Implementation method
1. Pure template language implementation
2. Implementation of custom simpletag (in essence, it simplifies the judgment of pure template language)
2, Fundamentals
The principle is to match the url filter conditions through django routing system, take the filter conditions as the database query results, and return the ...
Posted by JasperBosch on Thu, 30 Apr 2020 11:34:20 +0200
Developing a simple personnel management system with Python 3 + Django 3
1. Creating Django projects with pycharms
Remember to install mysqlclient
(1) Database configuration
We found the DATABASES configuration item in the settings.py file of the project, and changed its information to:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Or use mysql.connector.django
'NAME': 'u ...
Posted by PHP_TRY_HARD on Sat, 18 Apr 2020 19:42:09 +0200
Lu Feixue city deploying vue+django
Lu Feixue city deploying vue+django
Deployment of Luffy Learning City
One day, Ritian sent me two mysterious codes. It's said that they are the crystallization of mjj
I put these two codes on a website. You can download them by yourself
Lu Fei Xue Cheng django Code
https://files.cnblogs.com/files/tiger666/luffy_boy.zip
vu ...
Posted by faizanno1 on Sun, 12 Apr 2020 14:51:09 +0200
Source code analysis of Django rest framework (3) -- throttling
Add throttling
Custom throttling method
Limit access to 3 times within 60s
(1) Create a new throttle.py under the API folder. The code is as follows:
# utils/throttle.py
from rest_framework.throttling import BaseThrottle
import time
VISIT_RECORD = {} #Save access records
class VisitThrottle(BaseThrottle):
'''60s Can only ...
Posted by synical21 on Sat, 04 Apr 2020 10:06:33 +0200
Landing function landing success page (5)
"login success!" will be returned after the last article is successfully logged in String is just a temporary solution, just for the convenience of verifying the processing logic of login. After verification, it needs to be replaced by html page.
1. Think about what will happen after the successful login? The pre ...
Posted by hypertech on Thu, 02 Apr 2020 06:31:54 +0200
Common skills of Python Django REST framework
Conditional filtering
Common filtration
Example
Interface usage
Multilevel list
get find default non ID
Different api versions are not used
Browse times
Filter current user
Multi parameter use
Conditional filtering
Common filtration
_exact equals like 'aaa'
__iexact is exactly the same as ig ...
Posted by cmccomas on Thu, 02 Apr 2020 06:27:41 +0200