WSGI - 它如何影响我? [英] WSGI - How Does It Affect Me?

查看:92
本文介绍了WSGI - 它如何影响我?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我一直听到越来越多关于这个WSGI的东西,说实话,我还是不知道它究竟是什么以及它与CGI有何不同

在基础知识(现在尝试在网上研究这个)


我最困惑的是它对我的影响。我已经用Python编写了一些用于Python的小型CGI程序一段时间我需要

用于网络程序。 CGI现在被认为是坏吗?我只是总是

发现用CGI库快速写东西比用

来学习框架和安装它并确保我的

网站主机支持它。


我应该从CGI切换到WSGI吗?那有什么意思?什么是

等同于WSGI中的快速CGI脚本,或者我是否必须使用

框架?如果框架不满足我的需求并且我不想自己编程,我该怎么办?


示例如何框架有时候不能满足我的需求:

1.使用SQL Server(大多数框架似乎至少使其成为额外的工作)

2.需要Web应用程序通过API从其他程序获取数据(例如QuickBooks)

任何Web框架都可以使用win32扩展工作吗?

3.完全使用IIS,WSGI是否正常工作在IIS上,做任何框架吗?


希望这个问题不要太混乱或散乱,或者它之前没有被覆盖过。 (很难将这些问题作为搜索条件来构建

至少对我而言)


-Greg Pinero

So I keep hearing more and more about this WSGI stuff, and honestly I
still don''t understand what it is exactly and how it differs from CGI
in the fundamentals (Trying to research this on the web now)

What I''m most confused about is how it affects me. I''ve been writing
small CGI programs in Python for a while now whenever I have a need
for a web program. Is CGI now considered "Bad"? I''ve just always
found it easier to write something quickly with the CGI library than
to learn a framework and fool with installing it and making sure my
web host supports it.

Should I switch from CGI to WSGI? What does that even mean? What is
the equivalent of a quick CGI script in WSGI, or do I have to use a
framework even for that? What do I do if frameworks don''t meet my
needs and I don''t have a desire to program my own?

Examples of how frameworks don''t meet my needs sometimes:
1. Working with SQL Server (Most frameworks seem to at least make it extra work)
2. Need web app to get data from other programs via API (eg QuickBooks)
Can any web framework work happily with win32 extensions?
3. Using IIS at all for that matter, does WSGI work on IIS, do any frameworks?

Hope this question isn''t too confusing or rambling, or it hasn''t been
covered before. (it''s hard to frame these questions as search terms
at least for me)

-Greg Pinero

推荐答案

Gregory Pi?ero启发我们:
Gregory Pi?ero enlightened us with:

所以我一直听到越来越多关于这个WSGI的东西,老实说我还是b $ b仍然不明白它究竟是什么
So I keep hearing more and more about this WSGI stuff, and honestly I
still don''t understand what it is exactly



AFAIK它是网页框架的标准。在这样的框架中,您将获得一个请求对象,并返回一个响应对象。如果我是
正确,那么WSGI会描述这些对象上的方法和属性名称

等。

AFAIK it''s a standard for web frameworks. In such a framework, you
receive a ''request'' object, and return a ''response'' object. If I''m
correct, the WSGI describes things like the method and property names
on those objects etc.


我最困惑的是它对我的影响。我已经用Python编写了一些用于Python的小型CGI程序一段时间我需要

用于网络程序。 CGI现在被认为是坏吗?
What I''m most confused about is how it affects me. I''ve been writing
small CGI programs in Python for a while now whenever I have a need
for a web program. Is CGI now considered "Bad"?



我从未认为CGI不好,但我确实认为这是一件很麻烦的事情。

让任何事都变得非常重要。如果你想要一个带有模板引擎的网站,基于网络的数据库管理,以及自动表单生成和

验证,那么使用现有的Web框架会更容易。

I''ve never considered CGI bad, but I do consider it to be a hassle to
make anything non-trivial. If you want a website with template engine,
web-based database admin, and automatic form generation and
validation, it''s easier to use an existing web framework.


WSGI中的快速CGI脚本相当于什么,或者我是否有使用框架的
甚至为此?
What is the equivalent of a quick CGI script in WSGI, or do I have
to use a framework even for that?



我只是简单地使用CGI。

I''d simply use CGI for that.


如果框架没有,我该怎么办?不能满足我的需求而且我没有想要自己编程的
的愿望?
What do I do if frameworks don''t meet my needs and I don''t have a
desire to program my own?



这取决于我的需求。

That depends on the needs I guess.


框架如何不符合我的例子有时需要:

1.使用SQL Server(大多数框架似乎至少使它成为
额外工作)
Examples of how frameworks don''t meet my needs sometimes:
1. Working with SQL Server (Most frameworks seem to at least make it
extra work)



我从未见过一个无法使用SQL服务器的框架。

I''ve never seen a framework that''s unable to work with an SQL server.


2.需要网络应用程序才能从其他程序获取数据通过API(例如

QuickBooks)任何web框架都可以使用win32

扩展吗?
2. Need web app to get data from other programs via API (eg
QuickBooks) Can any web framework work happily with win32
extensions?



您可以在Django视图中使用任何模块,包括win32。

You can use any module you want in a Django view, including win32.


3.使用IIS就此而言,WSGI是否可以在IIS上运行,做任何

框架?
3. Using IIS at all for that matter, does WSGI work on IIS, do any
frameworks?



为什么要使用那种怪物?


Sybren

-

Sybren St ?? vel

St ?? vel IT - http://www.stuvel.eu/


2006年10月8日,Sybren Stuvel< sy ******* @ yourthirdtower.com.imaginationwrote:
On 10/8/06, Sybren Stuvel <sy*******@yourthirdtower.com.imaginationwrote:

3.完全使用IIS,WSGI在IIS上工作,做任何

框架?
3. Using IIS at all for that matter, does WSGI work on IIS, do any
frameworks?



为什么要使用那个怪物?


Why would you want to use that monstrosity?



两个字:合同义务


- Theerasak

Two words: "contractual obligation"

-- Theerasak

Theerasak Photha启发我们:
Theerasak Photha enlightened us with:

3.使用IIS [... ]
3. Using IIS [...]


为什么要使用那个怪物?


Why would you want to use that monstrosity?



两个字:合同义务


Two words: "contractual obligation"



这个问题没有回答。它只会让我向某人询问

else,即参与创建合同的各方。


Sybren

-

Sybren St ?? vel

St ?? vel IT - http://www.stuvel.eu/


这篇关于WSGI - 它如何影响我?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆