• Flask IV Template


    Four, template FMTV F: form form form M: Model model (database) T: Template template V: View View (Routing) 1. Rendering Template A template is a file containing response text, which contains dynamic parts represented by placeholder variables, and their specific values. It is known only in the context of the request. Replace variables with real […]

  • Django Learning Notes 2 of Python Third Party Library


    The project framework of the previous section has been set up, and now we begin to connect to the database and create the model. 1. Database SettingsPython installed SQLite database by default Open the file: dayang/settings.py ENGINE – Database Engine ‘django.db.backends.sqlite3’, ‘django.db.backends.postgresql’, ‘django.db.backends.mysql’, ‘django.db.backends.oracle’. NAME – Name of the database Tip: If you choose sqlite, […]

  • Django Foundation (11) Evolution of Viewsets in Different Versions of DRF


    View set brief introduction The REST framework includes an abstraction for handling ViewSets, which allows developers to concentrate on modeling API States and interactions and automatically process URL constructs according to conventions. ViewSet classes are almost the same as View classes, except that they provide operations such as read or update rather than methods such […]

  • Django development-configuration and use of mongodb


    Today, I have organized how to use mongodb in Django project. The environment is as follows:ubuntu18.04, django2.0.5, drf3.9, mongoengine0.16 Step 1: Configure mongodb and MySQL in settings.py as follows (you can use both MySQL and mongodb): DATABASES = { ‘default’: { ‘ENGINE’:’django. db. backends. mysql’, # database engine ‘NAME’:’django_test2′, # The name of the database […]

  • Deployment of Django2 project under Ubuntu Apache


    Environmental Science ubuntu:18.04 Apache:2.4.29 Python:3.6.6 Django:2.1.3 Python The system comes with Python 2.7.15rc and Python 3.6.6 Install Apache sudo apt install apache2 sudo apt install libapache2-mod-wsgi-py3 Install Django To experience Django2, you have to ask for Python 3, so the following are based on Python 3 Install pip sudo apt install python3-pip Install Django2 sudo […]

  • Vue + Django + Mysql to realize second-hand transaction application on mobile end


    This is a mobile second-hand trading application implemented with Vue + Django + mysql. Effect display Related warehouses Onehome: the front end of the project OnehomeServer: The back end of the project OnehomeDoc: Some documents for the project Completed function [x] login [x] registration [x] Home page display [x] Publish merchandise information (support multi-image upload) […]

  • Python Advancement: Custom Objects for Slicing


    Update Statement 2018-12-31: The Slice Series is composed of three articles and has now been merged into one. After merging, some serious errors (such as custom sequence slices) have been corrected, and a lot of changes have been made to the structure of the text and the cohesion of the chapters. The original series of […]

  • What did I write about four months of technical writing?


    Since last year’s National Day, I have updated the public number for four months, and published 40 original articles. According to the fine tradition of most individual subscribers, the subscriber should make a year-end summary around the year. However, for one thing, I was slow and did not keep up with the rhythm. For another […]

  • Django + Apache deployment


    Vomit trough This blog will detail every step of deploying Django. The existing online tutorials are too young and too old! Lots of holes! For the first time, the background is very confusing. The most pitfalls are that the installed WSGI modules need to be updated.Station B is really a place to learn.The video of […]

  • Django development-using celery to build distributed (multi-node) task queues


    Today, I introduce how to use celery to build a task queue with two nodes in the Django project (one master node and one sub-node; the master node publishes tasks, and the sub-node receives tasks and executes them). It’s similar to build three or more nodes, using celery, rabbitmq. The knowledge in celery and rabbitmq […]

  • JWT verification


    JWT (Json Web Token): The most popular cross-domain authentication solution at present.Previously, the authentication methods we used were based on Session:There is nothing wrong with this approach, but there are actually three shortcomings: Session is generally stored in redis, while redis data is stored in memory. With the increase of users, memory consumption is too […]

  • PEP 342 – Enhanced Generator: Coprocess


    The original text of PEP: https://www.python.org/dev/pe… PEP Title: Coroutines via Enhanced Generators PEP Author: Guido van Rossum, Phillip J. Eby Creation date: 2005-05-10 Incorporated version: 2.5 TranslatorPea blossoms cat (Python catAuthor of Public Number) Catalog brief introduction motivation Specification summary Specification: Send values to generators New generator method: send (value) New grammar: yield expression Specification: […]