Django 官方教程翻译项目Python 2 下请使用 __unicode__ 18. return self.headline 然后,运行 Django 命令行工具来创建数据库表。 1. $ python manage.py migrate migrate 命令会查找所有可用的模型,如果数据库中没有与之对应的表,则会为其自动创建。 Django 也提供了其他更丰富的控制方式。 接下来,你就可以使用一套便捷而丰富的 Django 如果你使用的是 Jython(一种 Java 平台的 Python 实现),你需要做一些额外的步骤。查看在 Jython 上运行 Django 获 取详细信息。 你可以在终端下输入命令 python 来验证是否已经安装 Python;你应该看到下面的信息: 1. Python 3.4.x 2. [GCC 4.x] on linux 3. Type "help", "copyright" 一个让公众查看投票内容并进行投票的公共站点。 一个能让你增加、修改和删除投票的管理界面。 我们假设你已经成功 安装 Django(zh)。如果你不清楚是否已经安装 Django 或不清楚安装的 是哪个版本,请运行以下命令: 1. $ python -m django --version 如果已安装,你会看到安装的版本号;如果还没安装,你会看到错误提示:“No module named django”。 本教程的目标版本是0 码力 | 103 页 | 1.86 MB | 1 年前3
Django、Vue 和Element UI 前后端原理论述Rest Framework->数据库配置 简要说明: 安装相关包:在开始之前,首先需要安装 Python 和 pip,然后安装 Django 等相关包, 可以使用 pip 命令来安装。 创建工程:使用 Django 的命令行工具创建 Django 项目,例如:django-admin startproject projectname。 后端依赖(pipenv)创建虚拟环境:建议使用 pipenv 结构。 前端依赖(npm install):在项目目录下执行 npm install 命令,安装项目所需的前端 4 《51 测试天地》七十四 www.51testing.com 依赖包,这些依赖包通常存储在 package.json 文件中。 前端服务配置启动:在项目目录下执行 npm run serve 命令,启动前端开发服务器, 可以在浏览器中预览项目。 三、关键技术介绍 1、后端 Pipfile.lock 文件中,这样可以确保项目在不同环境中安装相同的依赖版本。 简化依赖安装:使用 Pipenv 安装依赖非常简单,只需要运行一个命令即可,而不需 要手动管理依赖的安装。 提供更友好的命令行界面:Pipenv 提供了一组易于使用的命令,使得包管理和虚拟 环境管理更加直观和简便。 支持开发模式:Pipenv 支持将项目的开发依赖和运行时依赖分开,这样可以减少项 目打包时的冗余依赖。0 码力 | 61 页 | 6.84 MB | 1 年前3
Django 4.2.x DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a preexisting database? If I make changes to a model0 码力 | 3305 页 | 3.16 MB | 1 年前3
Django 4.1.x DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a preexisting database? If I make changes to a model0 码力 | 3240 页 | 3.13 MB | 1 年前3
Django 5.1 DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a preexisting database? If I make changes to a model0 码力 | 3513 页 | 3.17 MB | 1 年前3
Django 5.1.2 DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a preexisting database? If I make changes to a model0 码力 | 3519 页 | 3.17 MB | 1 年前3
Django 4.0.x DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a pre-existing database? If I make changes to a model0 码力 | 3184 页 | 3.14 MB | 1 年前3
Django 2.2.x DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Session security User-uploaded I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a pre-existing database? If I make changes to a model0 码力 | 2915 页 | 2.83 MB | 1 年前3
Django 5.0.x DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a preexisting database? If I make changes to a model0 码力 | 3407 页 | 3.21 MB | 1 年前3
Django 4.0.x DocumentationMigrations | Operations reference | SchemaEditor | Writing migrations • Advanced: Managers | Raw SQL | Transactions | Aggregation | Search | Custom fields | Multiple databases | Custom lookups | Query we’ll come to it in a moment - but first, let’s see what SQL that migration would run. The sqlmigrate command takes migration names and returns their SQL: $ python manage.py sqlmigrate polls 0001 You should screen so that you can see what SQL Django thinks is required. It’s useful for checking what Django is going to do or if you have database administrators who require SQL scripts for changes. If you’re0 码力 | 2248 页 | 7.90 MB | 1 年前3
共 36 条
- 1
- 2
- 3
- 4













