Tag:Blog post

  • Skillfully use` Promise.all `Implementation function: if a promise is resolved, the whole function will be resolved

    Time:2020-10-22

    When calling the distributed service interface, we often encounter such a problem: the interface side provides multiple IP addresses for users to call. As long as one of them returns successfully, it will be successful. For such a problem, a relatively simple solution is to call each interface in turn. If the previous interface fails […]

  • Image access with springboot + mongodb

    Time:2020-9-25

    Recently, we want to realize the function of publishing blog, which involves the saving and visiting of the pictures in the blog posts. The corresponding images in the blog posts are as follows:! [picture description] (picture URL)。 After the user uploads the image, we save it in the mongodb database and return the image URL […]

  • My blog development (001)

    Time:2020-9-22

    My blog development (001) File structure: from django.db import models from django.contrib.auth.models import User # Create your models here. class BlogType(models.Model):     type_name = models.CharField(max_length=15)     def __str__(self):         return self.type_name class Blog(models.Model):     title = models.CharField(max_length=50)     blog_type = models.ForeignKey(BlogType,on_delete=models.DO_NOTHING)     content = models.TextField()     author = models.ForeignKey(User,on_delete=models.DO_NOTHING)     created_time = models.DateTimeField(auto_now_add = True)     last_updated_time = models.DateTimeField(auto_now=True)     def __str__(self):         return “<Blog:%s>” % […]

  • My blog development (002)

    Time:2020-9-21

    My blog development (002) Because most of the three HTML are similar, in order to reduce duplication of work, create one base.html The file is used to store common content, and then leave their own unique code. When necessary, use block to call the corresponding content base.html <!DOCTYPE html> <html lang=”en”> <head>     <meta charset=”UTF-8″>     <title>Title</title> […]

  • My blog development (008)

    Time:2020-9-17

    Function increase: as shown in the figureImplementation method: filter method, as follows:modify views.py Content in:Then modify the blog_ detail.html Display structure and content of:The effect is as follows:But now I hope that if the previous one and the next one don’t have any, the next one will be the same. In addition, I hope that […]

  • My blog development (012)

    Time:2020-9-12

    The two disadvantages of optimization are as follows: Optimization disadvantage 1: background editing blog may affect data The blog content is separated from the count field, which is designed according to the acid principle: the model is reclassifiedSpecific operation: modify models.py :First remove the read in admin_ Numpython manage.py makemigrations; python manage.py migrate; then admin.py […]

  • My blog development (014)

    Time:2020-9-10

    Add a title to the previous Icon: home.html Add the x-axis category to the title in Title: {text: ‘reading change in the last 7 days’}, Add a get in utils_ today)hot_ The data method is used to get the hot data of today’s day # utils.py …… def get_today_hot_data(content_type):     “””     Used to get hot data […]

  • Redis cluster environment configuration of springboot series

    Time:2020-8-7

    The previous posts on redis are all based on stand-alone redis. However, in the actual production environment, the possibility of using a redis cluster should be greater than that of a stand-alone version of redis. How to operate a cluster’s redis? What is the difference between its configuration and that of a single machine, and […]

  • Using flask and mongoengine to develop a blog system

    Time:2020-6-27

    Flask is a lightweight web development framework with micro kernel. It can keep the kernel as simple as possible and provide flexible extension mechanism for development. At present, flask has a large number of high-quality extensions in the open source community, so using flask for web development is very efficient.Flash and mongoengine are used to […]

  • HTTP strong cache and negotiation cache

    Time:2020-6-4

    Theoretical knowledge and express.js In the next practice, this article of the front-end team of Zhengcai cloud has been very detailed: illustrating HTTP caching Strong cache and negotiation cache flow chart Figure from illustration HTTP cache Just now, I am also adding and summarizing the content of this section. Inspired by this excellent blog, I […]