Django 官方教程翻译项目内容简要介绍了如何使用 Django 实现一个数据库驱动的 Web 应用。 为了让您充分理解 Django 的工作原理,这份文档为您详细描述了相关的技术细节,不过这并不是 一份入门教程或者是参考文档(我们当然也为您准备了这些)。如果您想要马上开始一个项目,可以 从 实例教程(zh)开始入手,或者直接开始阅读详细的参考文档。 Django 无需数据库就可以使用,它提供了对象关系映射器(ORM)。通过此技术,你可以使用 。通过此技术,你可以使用 Python 代码来描述数据库结构。 数据模型语法提供了很多方法来描述你的数据,这解决了多年来在数据库模式中的难题。以下是一个 简明的例子: 1. # mysite/news/models.py 2. 3. from django.db import models 4. 5. class Reporter(models.Model): 6. full_name __unicode__ 18. return self.headline 然后,运行 Django 命令行工具来创建数据库表。 1. $ python manage.py migrate migrate 命令会查找所有可用的模型,如果数据库中没有与之对应的表,则会为其自动创建。 Django 也提供了其他更丰富的控制方式。 接下来,你就可以使用一套便捷而丰富的 Python0 码力 | 103 页 | 1.86 MB | 1 年前3
Django、Vue 和Element UI 前后端原理论述和 Element UI 前后 端原理论述 作者:M&T. 2 《51 测试天地》七十四 www.51testing.com 后端开发(Django+Rest Framework+MySQL): Django 负责处理 HTTP 请求和响应,以及 URL 路由的配置。它接收来自前端的 HTTP 请求,并根据 URL 将请求分发给相应的视图函数进行处理。 Rest Framework 的扩展,用于快速构建 RESTful API 接口。通过 Rest Framework,可以定义 API 视图和序列化器,实现数据的序列化和反序列化,从而方便地 与前端进行数据交互。 MySQL 是一个关系型数据库,用于存储后端的数据。 前端开发(Vue+Element UI): Vue 是一种现代的 JavaScript 框架,用于构建用户界面。Vue 提供了丰富的组件和模 块,可以帮助开发者构建交互式的单页面应用(SPA)。 com 二、搭建流程 2.1 后端搭建流程 安装相关包->创建工程->后端依赖(pipenv)创建虚拟环境->后端服务配置启动->后 端创建子应用->后端 Rest Framework->数据库配置 简要说明: 安装相关包:在开始之前,首先需要安装 Python 和 pip,然后安装 Django 等相关包, 可以使用 pip 命令来安装。 创建工程:使用 Django 的命令行工具创建0 码力 | 61 页 | 6.84 MB | 1 年前3
Django 5.1 DocumentationUtilities Settings Frequently Asked Questions Databases General notes PostgreSQL notes MariaDB notes MySQL notes SQLite notes Oracle notes Subclassing the built-in database backends Using a 3rd-party database is only necessary if you’d like to work with a “large” database engine like PostgreSQL, MariaDB, MySQL, or Oracle. To install such a database, consult the database installation information. Install Django run the command-line client for your database and type \dt (PostgreSQL), SHOW TABLES; (MariaDB, MySQL), .tables (SQLite), or SELECT TABLE_NAME FROM USER_TABLES; (Oracle) to display the tables Django created0 码力 | 3513 页 | 3.17 MB | 1 年前3
Django 5.1.2 DocumentationUtilities Settings Frequently Asked Questions Databases General notes PostgreSQL notes MariaDB notes MySQL notes SQLite notes Oracle notes Subclassing the built-in database backends Using a 3rd-party database is only necessary if you’d like to work with a “large” database engine like PostgreSQL, MariaDB, MySQL, or Oracle. To install such a database, consult the database installation information. Install Django run the command-line client for your database and type \dt (PostgreSQL), SHOW TABLES; (MariaDB, MySQL), .tables (SQLite), or SELECT TABLE_NAME FROM USER_TABLES; (Oracle) to display the tables Django created0 码力 | 3519 页 | 3.17 MB | 1 年前3
Django 5.0.x DocumentationUtilities Settings Frequently Asked Questions Databases General notes PostgreSQL notes MariaDB notes MySQL notes SQLite notes Oracle notes Subclassing the built-in database backends Using a 3rd-party database is only necessary if you’d like to work with a “large” database engine like PostgreSQL, MariaDB, MySQL, or Oracle. To install such a database, consult the database installation information. Install Django ENGINE – Either 'django.db.backends.sqlite3', 'django.db.backends.postgresql', 'django.db.backends.mysql', or 'django.db.backends.oracle'. Other backends are also available. NAME – The name of your database0 码力 | 3407 页 | 3.21 MB | 1 年前3
Django 4.2.x DocumentationUtilities Settings Frequently Asked Questions Databases General notes PostgreSQL notes MariaDB notes MySQL notes SQLite notes Oracle notes Subclassing the built-in database backends Using a 3rd-party database is only necessary if you’d like to work with a “large” database engine like PostgreSQL, MariaDB, MySQL, or Oracle. To install such a database, consult the database installation information. Install Django ENGINE – Either 'django.db.backends.sqlite3', 'django.db.backends.postgresql', 'django.db.backends.mysql', or 'django.db.backends.oracle'. Other backends are also available. NAME – The name of your database0 码力 | 3305 页 | 3.16 MB | 1 年前3
Django 3.2.x Documentationapps Settings Frequently Asked Questions Databases General notes PostgreSQL notes MariaDB notes MySQL notes SQLite notes Oracle notes Subclassing the built-in database backends Using a 3rd-party database is only necessary if you’d like to work with a “large” database engine like PostgreSQL, MariaDB, MySQL, or Oracle. To install such a database, consult the database installation information. Install Django ENGINE – Either 'django.db.backends.sqlite3', 'django.db.backends.postgresql', 'django.db.backends.mysql', or 'django.db.backends.oracle'. Other backends are also available. NAME – The name of your database0 码力 | 3121 页 | 3.08 MB | 1 年前3
Django 2.2.x Documentationand reusable apps Settings Frequently Asked Questions Databases General notes PostgreSQL notes MySQL notes SQLite notes Oracle notes Using a 3rd-party database backend django-admin and manage.py Usage This step is only necessary if you’d like to work with a “large” database engine like PostgreSQL, MySQL, or Oracle. To install such a database, consult the database installation information. Install Django ENGINE – Either 'django.db.backends.sqlite3', 'django.db.backends.postgresql', 'django.db.backends.mysql', or 'django.db.backends.oracle'. Other backends are also available. NAME – The name of your database0 码力 | 2915 页 | 2.83 MB | 1 年前3
Django 4.1.x DocumentationUtilities Settings Frequently Asked Questions Databases General notes PostgreSQL notes MariaDB notes MySQL notes SQLite notes Oracle notes Subclassing the built-in database backends Using a 3rd-party database is only necessary if you’d like to work with a “large” database engine like PostgreSQL, MariaDB, MySQL, or Oracle. To install such a database, consult the database installation information. Install Django ENGINE – Either 'django.db.backends.sqlite3', 'django.db.backends.postgresql', 'django.db.backends.mysql', or 'django.db.backends.oracle'. Other backends are also available. NAME – The name of your database0 码力 | 3240 页 | 3.13 MB | 1 年前3
Django 3.1.x Documentationapps Settings Frequently Asked Questions Databases General notes PostgreSQL notes MariaDB notes MySQL notes SQLite notes Oracle notes Subclassing the built-in database backends Using a 3rd-party database is only necessary if you’d like to work with a “large” database engine like PostgreSQL, MariaDB, MySQL, or Oracle. To install such a database, consult the database installation information. Install Django ENGINE – Either 'django.db.backends.sqlite3', 'django.db.backends.postgresql', 'django.db.backends.mysql', or 'django.db.backends.oracle'. Other backends are also available. NAME – The name of your database0 码力 | 3094 页 | 3.03 MB | 1 年前3
共 55 条
- 1
- 2
- 3
- 4
- 5
- 6













