简体   繁体   English

在Flask方面学习Ruby on Rails

[英]Learning Ruby on Rails in terms of Flask

I'm very experienced with Flask and have built a couple things in it. 我对Flask很有经验,并在其中做了几件事。 I'm just learning Rails, and since I know Flask the best, I keep on trying to tie everything I learn back to it. 我只是在学习Rails,因为我最了解Flask,所以我会继续尝试将我学到的所有知识都归结到它。 Would anyone mind explaining ROR in terms of Flask? 有人介意用Flask解释ROR吗? Obviously Flask isn't an MVC, but I have used it with SQLAlchemy, so I've been thinking of my Model as that. 显然Flask不是MVC,但是我将它与SQLAlchemy一起使用,因此我一直在考虑我的Model。

Learning Rails in terms of Flask is like trying to fit a large truck inside a small sports car. 从Flask方面学习Rails就像是将大型卡车装在小型跑车中一样。 Rails is a large framework full of powerful features and Flask is a micro framework with limited features designed to build simple sites fast. Rails是一个具有强大功能的大型框架,而Flask是一个具有有限功能的微型框架,旨在快速构建简单站点。 You are best off learning Rails on its own and then comparing the few features Flask has from Rails. 您最好自己学习Rails,然后比较Flask从Rails拥有的一些功能。

If you are finding Rails to be too much to learn at once, perhaps try Sinatra first. 如果您发现Rails不能一次学习太多,也许先尝试Sinatra。 It's a Ruby micro-framework from which Flask was cloned. 这是从Flask克隆而来的Ruby微框架。 Those two will have a lot in common. 这两个将有很多共同点。 After mastering Sinatra, Rails is a relatively easy step. 掌握了Sinatra之后,Rails是相对容易的一步。

Flask is small with few dependencies, you decide a lot of things, Rails is big and opinionated, Rails is Omakase . Flask小而几乎没有依赖关系,您可以决定很多事情,Rails大而固执己见, Rails是Omakase

You may think of Rails in Flask terms as long as you've used Flask like a classic MVC, but I'd recommend starting with a fresh mind. 只要您像经典的MVC一样使用Flask,就可以想到Flask术语中的Rails,但我建议您重新考虑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM