Introduction to the use of Celery in Django
Celery introduction
Cellery is a simple, flexible and reliable distributed system dealing with a large number of messages, and provides the necessary tools to maintain such a system.
It is a task queue that focuses on real-time processing and supports task scheduling.
What is task queue
Task queue: a mechanism to distribute tasks between thread ...
Posted by seaten on Mon, 04 Nov 2019 20:40:47 -0800
Vue+Django 2.0.6 learning notes 5.10 drf filtering
Well, I've missed 10-11 before. No wonder I started to look confused when I saw 6.5 in the video
Continue
class GoodsListViewset(mixins.ListModelMixin, viewsets.GenericViewSet):
"""
//Product list page
"""
serializer_class = GoodsSerializer
pagination_class = GoodsPagination
# Because GenericViewSet also ...
Posted by Frozen Kiwi on Sun, 03 Nov 2019 16:17:26 -0800
Flash, middleware
Catalog
Flash
Source code
case
middleware
Custom local Middleware
Custom global decorator
Flash
Flash() provides a very useful flash() function, which can be used to "flash" messages that need to be prompted to the user, such as "welcome back!" when ...
Posted by cvsherri on Sat, 02 Nov 2019 16:28:48 -0700
Database design of rbac component
rbac is a role-based permission design, which consists of six tables. The specific table design is as follows:
from django.db import models
class Menu(models.Model):
"""
//Menu table
"""
title = models.CharField(verbose_name='Menu name',max_length=32,unique=True)
icon = models.CharField(max_length=128, blank=True, ...
Posted by slweb on Sat, 02 Nov 2019 14:44:12 -0700
Multiplayer blog development project - Deployment
One backend code deployment
1 Django packaging
1 setup.py file creation
The details are as follows
#!/usr/bin/poython3.6
#conding:utf-8
from distutils.core import setup
import glob
setup(name='blog',
version='1.0',
description='demo blog',
author='zhang',
author_email='18829272841@163.com',
url='https://www. ...
Posted by gfoot on Wed, 30 Oct 2019 03:14:09 -0700
DJango background design
I. create administrator
Django provides admin background for unified management of users, permissions and permission groups, and super user initialization method.
Initialize command line:
python3 manage.py createsuperuser
Follow the prompts to set the user name, mailbox, and password:
User ...
Posted by divadiva on Mon, 28 Oct 2019 14:34:07 -0700
token backend parsing after jwt authentication generation
First, the front end sends the token
The location of token headers
{'authorization': value of token ', content type': application / JSON}
Write in ajax
//Show only part of the headers code
headers:{"authorization":this.$cookies.get("token")}
//token value is usually put in cookies
//The default is json format. You don't need to declare js forma ...
Posted by marklarah on Mon, 28 Oct 2019 07:05:12 -0700
Multiplayer blog development project - back end
Basic analysis
1 Analysis
For the blog system used by many people, the BS architecture is adopted here.Blog system needs user management and blog management
User management: user registration, adding, deleting, modifying and querying users
Blog management: add, delete, change and check blog
The database is required. This time, Mysql5.7.17 is ...
Posted by gbow on Mon, 28 Oct 2019 04:13:45 -0700
Python Road [chapter 29]: django ORM model layer
ORM introduction
An important part of MVC or MVC framework is ORM, which realizes the decoupling of data model and database, that is, the design of data model does not need to rely on specific database, and the database can be easily replaced through simple configuration, which greatly reduces the workload of developers and does not need to f ...
Posted by aximbigfan on Sun, 27 Oct 2019 23:49:45 -0700
Django's routing system
Catalog
One: URLconf configuration
(I): basic format
(II): parameter description
Two: regular expression usage analysis
(I): basic configuration
(II): precautions
Three: group name matching
(I): location of URLconf matching
(2): the captured parameters are always strings
(3): default value ...
Posted by Fking on Sun, 27 Oct 2019 19:09:19 -0700