什么是 Web 框架?它与 LAMP 相比如何? [英] What is a Web Framework? How does it compare with LAMP?

查看:16
本文介绍了什么是 Web 框架?它与 LAMP 相比如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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?

LAMP 比这些常见框架还慢 - 大多数人声称使用它们的框架部署 Web 应用程序很容易?

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 中执行的常见活动发展.

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.

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

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)是一个包含 Web 服务器 (Apache) 的软件包.这是一个实际运行您的 Web 应用程序的软件.简而言之,框架是帮助您加快开发速度的库.

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 是一个微框架,这基本上意味着它是一个占用空间小的框架(根据其文档,它适用于小型网站).

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).

姜戈 &Ruby on Rails 也是框架.Django 和 Flask 都是 Python 的框架,但 Rails 是 Ruby 的框架.

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

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

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).

这篇关于什么是 Web 框架?它与 LAMP 相比如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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