Flask Web Development翻译1

290 阅读3分钟

嗨大家好,最近突然迷失方向,于是半个专业对口,开始搞翻译。本人英语还可以,有意见/建议,或者想贡献那就太好了,直接评论叭。原文链接coddyschool.com/upload/Flas… 纯纯自己手动翻译,有不准的见谅。 (我会跳过一些开头)

Preface序言: Flask stands out from other frameworks because it lets developers take the driver’s seat and have full creative control of their applications. Maybe you have heard the phrase “fighting the framework” before. This happens with most frameworks when you decide to solve a problem with a solution that isn’t the official one. It could be that you want to use a different database engine, or maybe a different method of authenticating users. Deviating from the path set by the framework’s developers will give you lots of headaches.

Flask从其他框架中突出,因为它让开发者自己掌控搭建并且能完全有创造性地掌控他们的应用。或许你听过“与框架抗衡”这个词语。当你在大多数框架中决定以非官方的方法开发功能/解决问题就会发生这类情况。这类情况可能是你打算用不同的数据库,亦或是另一个验证用户的方法。偏离框架开发者给你铺好的道路会让你头疼不已。

Flask is not like that. Do you like relational databases? Great. Flask supports them all. Maybe you prefer a NoSQL database? No problem at all. Flask works with them too. Want to use your own homegrown database engine? Don’t need a database at all? Still fine. With Flask you can choose the components of your application or even write your own if that is what you want. No questions asked!

Flask并不像它们。你喜欢关系型数据库吗?太棒了。flask都支持。又或者你更喜欢NoSQL数据库?没问题。flask也同样与它们配合。想要用你自己原生的数据库引擎?不需要任何数据库?仍然没问题。用flask,你可以选择自己应用的组成部分甚至写你自己的(如果你想的话)。没任何问题!

The key to this freedom is that Flask was designed from the start to be extended. It comes with a robust core that includes the basic functionality that all web applications need and expects the rest to be provided by some of the many third-party extensions in the ecosystem and, of course, by you.

如此自由的根本是因为flask从设计之初就是用来被扩展的。flask有一个坚固的核心,使它包括了所有web应用具有的基本功能并且等着在社区中的许多第三方扩展来补全,当然了,flask还有着你。

In this book I present my workflow for developing web applications with Flask. I don’t claim to have the only true way to build applications with this framework. You should take my choices as recommendations and not as gospel.

这本书中,我会呈现我自己(Miguel Grinberg,作者)用flask开发web应用的工作流程。我不要求自己有着唯一搭建应用的正确道路。你应该将我的选择视为推荐而不是福音(我不太理解?)。

Most software development books provide small and focused code examples that demonstrate the different features of the target technology in isolation, leaving the “glue” code that is necessary to transform these different features into a fully working applications to be figured out by the reader. I take a completely different approach. All the examples I present are part of a single application that starts out very simple and is expanded in each successive chapter. This application begins life with just a few lines of code and ends as a nicely featured blogging and social networking application.

大部分软件开发书籍提供了聚焦问题的小段代码来独立演示目标技术的不同特征,然而却缺失了把这些特征转化成完整工作应用的”胶水代码”,转而让读者自己去写。我却完全不同。所有我给出的例子都是一个应用的部分,这个应用起步时非常简单并且在每一个章节之中扩展。应用从几行代码开始最终以一个精美的,有特色的博客与社交网络应用结束。

序言结束

书的受众群体

没啥翻译的意义,就说一下:python要有一定基础,最好对前端语言(html, css, js)和错误追踪熟悉(没说必要)。

好力读到这里吧,明天开始对flask的介绍的翻译。