什么是网络框架?与 LAMP 相比如何?

发布于 2024-10-08 10:59:22 字数 420 浏览 0 评论 0原文

我开始使用 LAMP/WAMP 进行 Web 开发,这对我来说是合乎逻辑的。 有一个名为 Apache 的 Web 服务器程序,它负责在端口 80(公共端口)上设置服务的网络部分。如果请求是常规 HTML,它将使用 HTTP 提供服务。如果请求是 PHP 资源,则有一个 mod_php,Apache 通过它调用 PHP 解释器来处理文件,并返回 HTML,该 HTML 再次像平常的 HTML 一样传输。

现在的问题是什么是 Web 框架?我遇到过基于 Python 的网站创建,其中有 Flask。什么是烧瓶,它与 LAMP 相比如何。此外,Django/Ruby on Rails 与 Flask 有何不同?

此外,LAMP 比这些常见框架慢吗?大多数人声称使用他们的框架可以轻松部署 Web 应用程序?

有人可以回答我并提供一些阅读这些内容的好地方吗?感谢您提前的答复。

I started web development in LAMP/WAMP and it was logical to me.
There is a Web Server program called Apache which does the networking part of setting up a service on port 80 (common port). If the request is regular HTML it serves it using HTTP. And if the request is a PHP resource, there is a mod_php with which the Apache invokes the PHP interpreter to process the file and it gives back HTML which is again transferred as usual HTML.

Now the question is what is a Web Framework? I came across Python based website creation and there is Flask. What is a flask, how does it compare with LAMP. Further are Django/Ruby on Rails different from flask?

Further is LAMP slower than these common frameworks - most claim that it is easy to deploy web apps using their framework?

Can someone answer me and also give some good places to read on these. Thanks for your answers in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

任性一次 2024-10-15 10:59:22

引用维基百科:

Web 应用程序框架是
软件框架旨在
支持动态发展
网站、网络应用程序和网络
服务。该框架旨在
减轻与相关的开销
Web 中执行的常见活动
发展。

基本上,Web 框架可以让您更轻松地开发应用程序。大多数网站都有一组通用的功能(例如处理会话、数据验证等),并且框架可以防止您在每次创建网站时重新编写这些功能。

LAMP(Linux、Apache、MySQL、PHP/Perl/Python)是一个包含Web 服务器 (Apache) 的软件包。这是一个实际运行您的网络应用程序的软件。简而言之,框架是帮助您更快开发的库。

Flask 是一个微框架,这基本上意味着它是一个占用空间小的框架(根据其文档,适用于小型站点)。

姜戈& Ruby on Rails 也是框架。 Django 和 Flask 都是 Python 框架,而 Rails 是 Ruby 框架。

我建议您在不借助框架的情况下构建应用程序,然后开始使用框架(这需要您了解模型-视图-控制器、ORM 等原理)。

To quote Wikipedia:

A web application framework is a
software framework that is designed to
support the development of dynamic
websites, web applications and web
services. The framework aims to
alleviate the overhead associated with
common activities performed in Web
development.

Basically, a web framework makes it easier for you to develop your application. Most sites have a common set of functionality (like handling sessions, data validation, etc) and a framework is something that prevents you from re-writing this each time you create a website.

LAMP (Linux, Apache, MySQL, PHP/Perl/Python) is a package that contains a web server (Apache). This is a piece of software that actually runs your web application. Frameworks are, in short, libraries that help you develop faster.

Flask is a microframework, which basically means that it is a framework with a small footprint (and meant for small sites, according to its docs).

Django & Ruby on Rails are also frameworks. Django and Flask are both frameworks for Python, but Rails is a framework for Ruby.

I would suggest that you build applications without the help of frameworks, and then jump into using frameworks (which require you to understand principles such as Model-View-Controller, ORM, and so forth).

小鸟爱天空丶 2024-10-15 10:59:22

什么是网络框架?

一堆在 Web 开发中执行常见任务的库,旨在协同工作。

什么是烧瓶

一个 Web 框架。

与 LAMP 相比如何

与制造汽车发动机零部件的工厂与道路的比较大致相同。

DJango / Ruby on Rails 与 Flask 有何不同?

是的。首先,Rails 是用不同的语言编写的。

what is a Web Framework?

A bunch of libraries that do common tasks in web development that are designed to work together.

What is a flask

A web framework.

how does it compare with LAMP

In roughly the same way that a factory making components for car engines compares to a road.

Further are DJango / Ruby on Rails different from flask ?

Yes. Rails is written in a different language for a start.

绅士风度i 2024-10-15 10:59:22

你似乎有点困惑。我建议您阅读以下链接:

如何为您的 Web 选择完美的技术堆栈
发展?

以获得正确答案。下面就让我一步步解答大家的疑惑。

Web 框架是一种软件框架,旨在支持动态网站、Web 应用程序和 Web 服务的开发。

Flask 是一个 Python Web 框架。

LAMP 是一个完整的 Web 开发堆栈。因此,将 Flask(一个 Web 框架)与 LAMP(一个 Web 开发堆栈)进行比较是不准确的。在一个非技术示例中,想象一下将钓鱼竿绳与整个钓鱼设备套件进行比较。

如果您将 Flash 与 LAMP 进行比较,那么只能通过一种方式来完成。 LAMP 使用 PHP,因此该堆栈与 PHP 的所有框架兼容。因此,您应该将 Flask 与各种 PHP 框架(如 Laravel、Codeigniter、CakePHP 等)进行比较。

有关 Web 框架和 Web 开发堆栈的更多信息,我建议您阅读此博客

Web 开发的最佳技术堆栈

You seem to be a bit confused. I suggest you read from the below link :

How To Choose The Perfect Technology Stack For Your Web
Development?

to get the correct answers. In the meantime, let me clear your doubts step by step.

A web framework is a software framework that is designed to support the development of dynamic websites, web applications, and web services.

Flask is a Python web framework.

LAMP is a complete web development stack. So comparing flask (a web framework) to LAMP (a web development stack) is simply not accurate. In a non-technical example, imagine comparing a fishing rod string to an entire fishing equipment kit.

If you are comparing Flash to LAMP then it can be only done in one way. LAMP uses PHP, and so this stack is compatible with all the frameworks of PHP. So you should compare Flask to various PHP frameworks like Laravel, Codeigniter, CakePHP, etc.

For further information on web frameworks and web development stacks, I would suggest you read this blog on

The Best Technology Stacks for Web Development

.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文