django简介_Django简介

django简介

Hello everyone, from today we’re going to start a new tutorial series on Django framework. In this tutorial we will cover basic introduction of Django. Before start to learn, lets have a look on some most frequently asked questions about Django. These questions will help you to understand that what actually Django is.

大家好,从今天开始,我们将开始有关Django框架的新教程系列。 在本教程中,我们将介绍Django的基本介绍。 在开始学习之前,让我们看一下有关Django的一些最常见问题。 这些问题将帮助您了解Django到底是什么。

  1. What is Django?

    什么是Django?

  2. Why use Django?

    为什么要使用Django?

  3. How does Django work?

    Django如何运作?

  4. Is Django stable?

    Django稳定吗?

  5. What are the requirements to learn Django?

    学习Django有哪些要求?

So let’s answer these questions one by one.

因此,让我们一个接一个地回答这些问题。

Introduction to Django

Image Source

图片来源

Django简介 (Introduction to Django)

什么是Django? (What is Django?)

Django is open-source and free web framework. It is written in Python language. It was created about 13 years ago (21 july 2005) and the latest and stable release Django 2.1 is out this year (1 august 2018) with a whole new set of features and capabilities. It is maintained by the Django Software Foundation, an independent organization established as a 501 non-profit. Django is a framework for web developers, it provides amazing infrastructure required for database-driven websites that have user authentication, content administration, file uploads, and much more.

Django是开源和免费的Web框架。 它是用Python语言编写的。 它创建于大约13年前(2005年7月21日),最新稳定的版本Django 2.1将于今年(2018年8月1日)发布,它具有一系列全新的功能。 它由Django Software Foundation(一个由501非营利组织成立的独立组织)维护。 Django是Web开发人员的框架,它为数据库驱动的网站提供了惊人的基础架构,这些网站具有用户身份验证,内容管理,文件上传等等。

We doesn’t have to create all these features from sratch, we can use Django framework and utilize these components that are already built-in there, so we can save a lot of time by using these inbuilt components. If you love to working  with python, especially for web application or web design, then you should learn the Django framework.

我们不必从sratch创建所有这些功能,我们可以使用Django框架并利用其中已经内置的这些组件,因此,通过使用这些内置的组件,可以节省大量时间。 如果您喜欢使用python,特别是对于Web应用程序或Web设计,则应该学习Django框架。

为什么要使用Django? (Why use Django?)

We already have seen that how it saves a lot of time for us. There are some another reasons to use Django framework.

我们已经知道它如何为我们节省大量时间。 还有其他使用Django框架的原因。

  1. Components: It is a light weight and stand alone web server where we can develop and test our project, a template system that uses the concept of inheritance from OOP, supports caching the data into memory, supports middleware framework (a light and low level plugin which is a system for altering input and output of django), consists of an object-relational mapper (ORM) that mediates between python classes and a relational database and many other components are there.

    组件:这是一个重量轻且独立的Web服务器,我们可以在其中开发和测试我们的项目,该模板系统使用从OOP继承的概念,支持将数据缓存到内存中,支持中间件框架(轻量级和低级插件)这是一个用于更改django的输入和输出的系统),由在python类和关系数据库之间进行中介的对象关系映射器(ORM)组成,并且还有许多其他组件。

  2. Bundled Applications: Django also includes a number of applications in its contrib package like – dynamic admin interface, an extensible authentication system that follows EAP (extensible authentication protocol), tools for creating Atom (web feeds) and RSS, tools for producing google sitemaps, a site’s framework which allows us to install django only once and run more than one websites, having different contents, inbuilt tool to reduce cross-site scripting, cross-site request forgery, SQL injection, cracking password and mitigate other web attacks.

    捆绑的应用程序: Django在其contrib软件包中还包括许多应用程序,例如–动态管理界面,遵循EAP(可扩展身份验证协议)的可扩展身份验证系统,用于创建Atom(网络供稿)和RSS的工具,用于生成Google Sitemaps的工具,一个站点的框架,该框架允许我们仅安装django并运行多个具有不同内容的网站,并使用内置工具来减少跨站点脚本编写,跨站点请求伪造,SQL注入,破解密码并缓解其他Web攻击。

  3. Extensibility: Django allows us plug the third party code into a regular project, so that it can be re-used. There are around 2500 packages to extend the framework’s original behavior.

    可扩展性: Django允许我们将第三方代码插入到常规项目中,以便可以重复使用。 大约有2500个软件包可以扩展框架的原始行为。

There are many other reasons to use Django framework, which will you know while learning it.

使用Django框架还有许多其他原因,您在学习它时会知道这些。

Django如何运作? (How does Django work?)

It can be broken into several components like Models.py, URL.py, Views.py files. Each file have their own specification like Models.py defines our data model by extending your single code line into full database tables and add a pre-built administration section to manage content, while on other hand Views.py is the main part of Django. Actual processing happens in view. We’ll discuss it later in detail.

它可以分为几个组件,例如Models.py,URL.py,Views.py文件。 每个文件都有自己的规范,例如Models.py通过将您的单个代码行扩展到完整的数据库表并添加预建的管理部分来管理内容来定义我们的数据模型,而Views.py是Django的主要部分。 实际处理发生在视图中。 我们将在后面详细讨论。

Django稳定吗? (Is Django stable?)

Of course, Django is stable. Most of the companies are using it. Some of them are:

当然,Django是稳定的。 大多数公司都在使用它。 他们之中有一些是:

  • Bitbucket

    比特桶
  • Instagram

    Instagram
  • Pinterest

    Pinterest
  • Mahalo

    马哈洛
  • The washington post’s webstite

    华盛顿邮报的网站

学习Django有哪些要求? (What are the requirements to learn Django?)

You should be familiar with basic syntax of Python, functions, importing external modules, conditional operator, loops, Regular Expression, data structure like tuple, set and dictionary, and a computer to work with.

您应该熟悉Python的基本语法,函数,导入外部模块,条件运算符,循环,正则表达式,数据结构(如元组,集合和字典)以及要使用的计算机。

That’s all for this article, if you have any problem or question related to introduction to Django then comment below, we’ll reply as soon as possible.

这就是本文的全部内容,如果您对Django简介有任何疑问或问题,请在下面评论,我们将尽快答复。

翻译自: https://www.thecrazyprogrammer.com/2018/08/introduction-to-django.html

django简介

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值