• Flash tutorial HTTP method


    HTTP protocol is the foundation of data communication in the world wide web. In this protocol, different methods can be used to obtain data for the same URLSeveral different HTTP methods are shown below GETThe most common method is to send unencrypted information to a server HEADThis method is the same as get except that […]

  • Flash tutorial template


    We can make functions bound to a URL return HTML. For example, in the following code,hello()The function returns the<h1>Hello World string of the package from flask import Flask app = Flask(__name__) @app.route(‘/’) def index(): return ‘<html><body><h1>Hello World'</h1></body></html>’ if __name__ == ‘__main__’: app.run(debug = True) But you can see that it’s stupid to directly return HTML […]

  • Flash tutorial — static files


    A web application often needs static files such as JavaScript or CSS to help the web page better display the content. Usually, the web server is used to provide this static file service, but in the development stage of the flag program, these files need to be placed in the static folder under the root […]

  • Flash tutorial — request object


    In flask, the request sent by the web page is transferred to the server and transformed into a global request object. In order to process the request object, we need to reference it from the flask package.The important properties of the request object are as follows: formThe key value pairs of this dictionary object represent […]

  • Flash tutorial — send form data to template


    As we have seen before, in flask, we can specify HTTP methods for URL rules, and the corresponding functions can receive form data in the form of dictionaries, and then deliver the data to the template and finally render it as a web page In the following example, the URL ‘/’ renders a web page […]

  • Some new postures of ES6


    Original: Javascript ES6 – (Exploring the new built in methods) Object property assignment When dealing with objects, you may need to combine multiple objects, new Object.assign()Functions can do this succinctly. Object merging Our goal is to combine the objects of 2-4 lines into one object. In Es5, you need to loop several objects and assign […]

  • Flash tutorial cookie


    Cookie is a kind of data stored in the client computer in the form of text. Its function is to record and track the data used by the client for statistics and better user experience The global request object of flask contains the cookie attribute, which is a dictionary object. Its key value pair is […]

  • Flash tutorial – redirection and errors


    The flask class has oneredirect()Method. When we call it, it returns a response object and redirects the user to another location with the specified status code redirect()The prototype of the method is as follows: Flask.redirect(location, statuscode, response) In the above function, locationThe URL Location we want to redirect statuscodeThe status code will be sent to […]

  • Flash tutorial – Session


    Unlike cookies, session data is stored on the server. Session refers to the time period between login and logout of a client on a web service. Session data that needs to be stored in a session is stored in a temporary directory on the server Each session is assigned a session ID, the session data […]

  • We have a problem with problems


    Original: https://pouchdb.com/2015/05/1 JavaScript friends, it’s time to admit: we have a problem with problems. No, not promises themselves. As defined by a + spec, promises are great. In the past year, when I saw many programmers struggling with the pouchdb API and other promise heavy APIs, I found a big problem:Many of us don’t really […]

  • Skillfully using “translation” function to solve the problem that web pages cannot be copied


    Many websites don’t allow copying website content, but there are many ways to solve the problem that can’t be copied. Here is a tip to use the “translation” function of web pages. For example, if you want to copy a paragraph of text on a web page, you need to register to copy it. How […]

  • Baidu translation API practice


    Refer to official documents: customized translation API technical documents Required transmission parameters In addition to the content to be translated and the specified language, Baidu‘s API needs to produce three parameters related to authorization and authentication. Formal API call API address:https://fanyi-api.baidu.com/api/trans/vip/translateMake sure you see thevip, not in the official documentsprivate。 It’s a big hole. Submission […]