Flask framework configuration Celery-[2]: Save the files uploaded by the front end through asynchronous tasks, and process the uploaded files asynchronously

1. General directory of the project It mainly introduces the configuration of celery. Everyone knows the relevant configuration of flask by default. flask-object |–apps |–user views.py __init__.py |–celery_task __init__.py asycn_task.py celery.py celeryconfig.py check_task.py scheduler_task.py app.py Dependency packages: celery==4.4.7 eventlet==0.33.3 Flask==2.1.3 Flask-Caching==1.10.1 Flask-Cors==3.0.10 Flask-Migrate==2.7.0 Flask-RESTful==0.3.9 Flask-SocketIO==5.1.1 Flask-SQLAlchemy==2.5.1 PyMySQL==1.0.2 redis==3.5.3 SQLAlchemy==1.4.0 Werkzeug==2.0.2 2. Celery project configuration 1. […]

MinIO pictures are uploaded normally and cannot be viewed. MinIO cannot set the bucket to public through the MinIO page.

Project scenario: After the domestic winning bid of Kirin operating system was deployed and MinIO was started normally, it was found that the picture could be uploaded normally, but the picture could not be viewed when browsing anonymously. After querying the solution on the Internet, we came to the conclusion that the bucket of the […]

SpringBoot automatically configures preloaded classes-01

Get configuration class package com.xbm; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext; @MapperScan(“com.xbm”) @SpringBootApplication(scanBasePackages = “com.xbm”) public class SpringBootWebApplication {<!– –> public static void main(String[] args) {<!– –> ConfigurableApplicationContext run = SpringApplication.run(SpringBootWebApplication.class, args); String[] beanDefinitionNames = run.getBeanDefinitionNames(); for (String beanName : beanDefinitionNames) {<!– –> System.out.println(“beanName:” + beanName); } } } operation result: beanName:org.springframework.context.annotation.internalConfigurationAnnotationProcessor beanName:org.springframework.context.annotation.internalAutowiredAnnotationProcessor […]

Pygame Lesson 3: Moving Loaded Images

Table of Contents 1. Load pictures 1.1 pygame.image.load() 1.2 Surface.blit() 1.3 Sample program 2. Mobile pictures 2.1 How to move 2.2 Eliminate traces 2.3 Control frame rate 3. Solve exceptions 3.1 FileNotFoundError: No file ‘xxx’ found in working directory ‘C:\Users\lion\AppData\Local\Programs\Python\Python38’. 3.1.1 Path problem 3.1.2 PATH environment variable problem 3.2 SyntaxError: (unicode error) ‘unicodeescape’ codec can’t […]

Chapter 7: Dynamically loaded data processing (selenium)

The relationship between selenium modules and crawlers Conveniently obtain dynamically loaded data from the website Conveniently implement simulated login What is selenium module A module based on browser automation Selenium usage process: – Environment installation: pip install selenium – Download a browser driver (Google Chrome) – Download path: http://chromedriver.storage.googleapis.com/index.html The resource is bound to chhromedriver.exe […]

2 ways to process loaded image data in pytorch

The first method: through the built-in ImageFolder() method in pytorch Take the following data set as an example: # 1. Use the ImageFolder() function that comes with torch to create a data source data_dir = r’D:/Projects/Datasets/flower_data/’ train_dir = data_dir + ‘/train’ valid_dir = data_dir + ‘/valid’ cat_to_name_file = r’D:/Projects/Datasets/flower_data/cat_to_name.json’ # The following is ”’for ResNet”’ […]

operator keyword (overloaded operator) in C++

Reprint address: https://www.cnblogs.com/ZY-Dream/p/10068993.html operator is a keyword of C++. It is used together with operator to represent an operator function. Operator= should be regarded as a function name as a whole when understood. This is C++’s method of extending operator functions. Although it looks weird, it is understandable: on the one hand, the operator must […]

04 python38’s scrapy and selenium handle asynchronously loaded dynamic html pages

1 For the asynchronously loaded html page, the page source code data xpath cannot be found 1.0 Website Analysis #Taobao search page URL: https://s.taobao.com/search?q=mobile phone #Search list page analysis: First page: https://s.taobao.com/search?q=mobile phone Second page: All are generated by ajax requests Last page: all generated by ajax requests Request method get Return data as html […]