Joke Collection Website - Public benefit messages - How to develop an api with python?
How to develop an api with python?
The online course I studied at the beginning was done with flask framework, and it was easy to get started: I would write a small website when I was studying, and I wanted to switch to python back-end development, and then I went to do data mining, but it didn't take long and I was a little rusty. Generally speaking, there are several modules: route () decorator binds a function to the corresponding URL, and Flask's URL rule is a routing module based on Werkzeug.
The idea behind this module is based on the precedent advocated by Apache and early HTTP servers to ensure elegant and unique URL. Template rendering Jinja2 Generating HTML in Python is very boring, because you have to escape the HTML manually to ensure the security of the application. To this end, Flask is equipped with a Jinja2 template engine.
Of course, other template engines can also be used, but it is recommended to use jinja2 template to request objects. You can use the global request object to access incoming request data. Flask processes incoming request data and allows you to access it using this global object. If you work in a multithreaded environment, Flask internally guarantees that you will always get the correct data on the current thread.
Database interaction -Flask-SQLAlchemy adds, deletes, modifies and queries the database through SQLAlchemy, and uses orm mode without writing SQL statements. In a database, a table is a python class, and an instance of the class is a row in the table. In the development process, some advanced applications of python will be used: decorator: module import is very necessary for permission verification; Prevent image processing from being imported circularly; Using verification code to generate attributes: About front-end using password encryption. If you are not familiar with the front end, you want to be a small website trainer. I recommend you to use Bootstrap, which contains various CSS styles, various components, JS plug-ins, and some website examples for your reference. You are not familiar with front-end HTML and CSS.
Postscript: Future data mining workers may also need to understand the back-end development of the website, because future modeling will not always be in a stand-alone machine, but may be integrated into the website, and real-time data will flow into the model and the results will be displayed on the website.
- Previous article:Qq Party withdrew a message. How to clear this record?
- Next article:SMS is not backed up.
- Related articles
- When will the ticket refund bought by Ctrip be refunded?
- How to repair credit by breaking promise
- How to tell if a man is cheating?
- How to view the remaining traffic of Huawei mobile phones?
- How Unicom users send short messages to telecom cards for free!
- Copywriting suitable for Tomb-Sweeping Day
- You can buy a cell phone that charges for five minutes, but you can never find anyone who can talk for two hours.
- Is there a charge for SMS reminder of Alipay?
- Dragon Boat Festival SMS greetings to elders
- Birthday greetings to elders and aunts