博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Aaron Swartz Rewriting Reddit中关于web.py的创建思路
阅读量:6821 次
发布时间:2019-06-26

本文共 960 字,大约阅读时间需要 3 分钟。

这天才少年居然自杀了,哎

原文

 

So how should things work? The first principle is that code should be clear and simple. If you want to output some text, you call web.output. If you want to get form input, you call web.input. There’s nothing particularly hard to remember.

The second principle is that web.py should fit your code, not the other way around. Every function in web.py is completely independent, you can use whichever ones you want. You can put your files wherever you like, and web.py will happily follow along. If you want a piece of code to be run as a web app, you call web.run, you don’t put your code in the magical place so that web.py can run you.

The third principle is that web.py should, by default, do the right thing by the Web. This means distinguishing between GET and POST properly. It means simple, canonical URLs which synonyms redirect to. It means readable HTML with the proper HTTP headers.

转载于:https://www.cnblogs.com/TLightSky/p/4079337.html

你可能感兴趣的文章
[Unit Testing] Mock a Node module's dependencies using Proxyquire
查看>>
C++中malloc/free和new/delete 的使用
查看>>
ASP.NET MVC读取XML并使用ViewData显示
查看>>
4.lists(双向链表)
查看>>
微服务(Microservices )简介
查看>>
.NET中的流
查看>>
在ASP.NET MVC 4中使用Kendo UI Grid
查看>>
SpringCloud_概述与入门
查看>>
vim精简版教程
查看>>
干货 | 用python3+dlib教你的程序察言观色
查看>>
Kafka的Consumer负载均衡算法
查看>>
换个姿势学数学:二次函数与拆弹部队
查看>>
React-事件机制杂记
查看>>
python的常用模块
查看>>
我的友情链接
查看>>
Delphi下WebBrowser应用示例
查看>>
AS3的http
查看>>
启动模式、时钟浅见
查看>>
ORA-01033: ORACLE initialization or shutdown in progress ,Enterprise Manager Console
查看>>
Intellij IDEA 一些不为人知的技巧
查看>>