cutelyst教程_01 _简介

Tutorial_01_Intro

教程_01 _简介

Daniel Nicoletti edited this page on Feb 20, 2019 · 9 revisions

Daniel Nicoletti于2019年2月20日编辑了本页

OVERVIEW

总览

  1. Introduction
  2. Cutelyst Basics
  3. More Cutelyst Basics
  4. Basic CRUD
  5. Authentication

INTRODUCTION

前 言

This tutorial is an adaptation of the great Catalyst Tutorial to match what we currently have in Cutelyst.

本教程是对great Catalyst教程的改编,与我们目前在Cutelyst中的内容相匹配。

DESCRIPTION

说明

This tutorial provides a multi-part introduction to the Cutelyst Web Framework. It seeks to provide a rapid overview of many of its most commonly used features. The focus is on the real-world best practices required in the construction of nearly all Cutelyst applications.

本教程分多个部分介绍Cutelyst Web框架。它试图快速概述许多最常用的功能。重点是几乎所有Cutelyst应用程序的构建所需的实际最佳实践。

Although the primary target of the tutorial is users new to the Cutelyst framework, experienced users may wish to review specific sections (for example, how to add authentication and authorization to an existing application).

尽管本教程的主要目标是刚刚接触Cutelyst框架的用户,但有经验的用户可能希望查看特定部分(例如,如何向现有应用程序添加身份验证和授权)。

Download the tutorial source code

下载教程源代码

These reference implementations are provided so that when you follow the tutorial, you can use the code to ensure that your system is set up correctly, and that you have not inadvertently made any typographic errors, or accidentally skipped part of the tutorial.

提供这些参考实现的目的是,当您遵循本教程时,可以使用这些代码来确保系统设置正确,并且不会无意中出现任何印刷错误,或意外跳过本教程的一部分。

NOTE: Cutelyst can run on any OS supported by Qt, you only need to pay attention to minimum Qt version required. It should make little or no difference to Cutelyst's operation, but this tutorial has been written using the Debian-based Tanglu OS.

注意:Cutelyst可以在Qt支持的任何操作系统上运行,您只需要注意所需的最低Qt版本。这对Cutelyst的操作应该没有什么影响,但本教程是使用基于Debian的Tanglu操作系统编写的。

Subjects covered by the tutorial include:

本教程涵盖的主题包括:

  • A simple application that lists and adds books.
  • 一个列表和添加书籍的简单应用程序。
  • How to write CRUD (Create, Read, Update, and Delete) operations in Cutelyst.
  • 如何在Cutelyst中编写CRUD(创建、读取、更新和删除)操作。
  • Authentication ("auth").
  • 身份验证(“auth”)。
  • Role-based authorization ("authz").
  • 基于角色的授权(“authz”)。
  • Attempts to provide an example showing current Cutelyst practices.
  • 试图提供一个展示当前Cutelyst实践的示例。
  • The use of Grantlee Template (Django).
  • Grantle模板(Django)的使用。
  • Useful techniques for troubleshooting and debugging Cutelyst applications.
  • 用于排除故障和调试Cutelyst应用程序的有用技术。
  • The use of SQLite as a database.
  • 使用SQLite作为数据库。

This tutorial makes the learning process its main priority. For example, the level of comments in the code found here would likely be considered excessive in a "normal project." Because of their contextual value, this tutorial will generally favor inline comments over a separate discussion in the text. It also deliberately tries to demonstrate multiple approaches to various features (in general, you should try to be as consistent as possible with your own production code).

本教程将学习过程作为首要任务。例如,在“正常项目”中,此处代码中的注释级别可能会被认为过高由于它们的上下文价值,本教程通常倾向于内联注释,而不是文本中的单独讨论。它还特意尝试演示各种特性的多种方法(一般来说,您应该尽量与自己的产品代码保持一致)。

Furthermore, this tutorial tries to minimize the number of controllers, templates, and database tables. Although this does result in things being a bit contrived at times, the concepts should be applicable to more complex environments.

此外,本教程将尽量减少控制器、模板和数据库表的数量。虽然这确实会导致事情有时有点做作,但这些概念应该适用于更复杂的环境。

VERSIONS AND CONVENTIONS USED IN THIS TUTORIAL

本教程中使用的版本和约定

This tutorial was built using the following resources. Please note that you may need to make adjustments for different environments and versions:

本教程是使用以下资源构建的。请注意,您可能需要针对不同的环境和版本进行调整:

  • Ubuntu 17.10
  • Cutelyst 2.1.0
  • Qt 5.6
  • Grantlee 5.0
  • SQLite 3

uWSGI can also be used by replacing cutelyst-wsgi2 with uwsgi and loading the cutelyst plugin, Cutelyst-WSGI supports HTTP, HTTPS and FastCGI while being faster, using less memory, and supporting HTTP keep-alive and pipelining), which is enough for production and development even on embedded hardware.

uWSGI还可以通过使用uWSGI替换cutelyst-wsgi2并加载cutelyst插件来使用,Cutelyst-WSGI支持HTTP、HTTPS和FastCGI,同时速度更快,使用更少的内存,并支持HTTP保持活动和流水线),这就足以支持生产和开发,即使是在嵌入式硬件上。

DATABASES

数据库

This tutorial will primarily focus on SQLite because of its simplicity of installation and use; however, modifications in the script required to support MySQL and PostgreSQL will be presented in the Appendix.

本教程将主要关注SQLite,因为它的安装和使用非常简单;不过,支持MySQL和PostgreSQL所需的脚本修改将在附录中介绍。

You can jump to the next chapter of the tutorial here: Cutelyst Basics

​你可以在这里跳到教程的下一章:Cutelyst基础知识

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值