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 2.2.x Documentationoperating system’s package manager. You can verify that Python is installed by typing python from your shell; you should see something like: Python 3.x.y [GCC 4.x] on linux Type "help", "copyright", "credits" official release. Verifying To verify that Django can be seen by Python, type python from your shell. Then at the Python prompt, try to import Django: >>> import django >>> print(django.get_version()) already. You can tell Django is installed and which version by running the following command in a shell prompt (indicated by the $ prefix): $ python -m django --version If Django is installed, you should0 码力 | 2915 页 | 2.83 MB | 1 年前3
 Django 2.1.x Documentationoperating system’s package man- ager. You can verify that Python is installed by typing python from your shell; you should see something like: 12 Chapter 2. Getting started Django Documentation, Release 2.1 official release. 2.2.4 Verifying To verify that Django can be seen by Python, type python from your shell. Then at the Python prompt, try to import Django: >>> import django >>> print(django.get_version()) already. You can tell Django is installed and which version by running the following command in a shell prompt (indicated by the $ prefix): $ python -m django --version If Django is installed, you should0 码力 | 1910 页 | 6.49 MB | 1 年前3
 Django 2.1.x Documentationoperating system’s package manager. You can verify that Python is installed by typing python from your shell; you should see something like: Python 3.x.y [GCC 4.x] on linux Type "help", "copyright", "credits" official release. Verifying To verify that Django can be seen by Python, type python from your shell. Then at the Python prompt, try to import Django: >>> import django >>> print(django.get_version()) already. You can tell Django is installed and which version by running the following command in a shell prompt (indicated by the $ prefix): $ python -m django --version If Django is installed, you should0 码力 | 2790 页 | 2.71 MB | 1 年前3
 Django Q Documentation
Release 0.7.9Successful tasks Failed tasks Scheduled tasks Queued tasks Examples Emails Signals Reports Haystack Shell Groups Index Search Page © Copyright 2015, Ilan Steemers. Created using Sphinx 1.3.1. index modules schedule('tasks.clear_sessions_command', schedule_type='H') Check out the Shell examples if you want to schedule regular shell commands Reference schedule(func, *args, name=None, hook=None, schedule_type='O' adding a post_delete signal and calling index.remove_object in the async function. Shell You can execute or schedule shell commands using Pythons subprocess [https://docs.python.org/3.5/library/subprocess0 码力 | 62 页 | 514.67 KB | 1 年前3
 Django 1.11.x DocumentationDjango on Jython for details. You can verify that Python is installed by typing python from your shell; you should see something like: Python 3.4.x [GCC 4.x] on linux Type "help", "copyright", "credits" official release. 2.2.5 Verifying To verify that Django can be seen by Python, type python from your shell. Then at the Python prompt, try to import Django: >>> import django >>> print(django.get_version()) already. You can tell Django is installed and which version by running the following command in a shell prompt (indicated by the $ prefix): $ python -m django --version If Django is installed, you should0 码力 | 1878 页 | 6.40 MB | 1 年前3
 Django 1.11.x DocumentationDjango on Jython for details. You can verify that Python is installed by typing python from your shell; you should see something like: Python 3.4.x [GCC 4.x] on linux Type "help", "copyright", "credits" official release. Verifying To verify that Django can be seen by Python, type python from your shell. Then at the Python prompt, try to import Django: >>> import django >>> print(django.get_version()) already. You can tell Django is installed and which version by running the following command in a shell prompt (indicated by the $ prefix): $ python -m django --version If Django is installed, you should0 码力 | 2747 页 | 2.67 MB | 1 年前3
 Django 2.0.x Documentationoperating system’s package man- ager. You can verify that Python is installed by typing python from your shell; you should see something like: Python 3.4.x [GCC 4.x] on linux Type "help", "copyright", "credits" official release. 2.2.5 Verifying To verify that Django can be seen by Python, type python from your shell. Then at the Python prompt, try to import Django: >>> import django >>> print(django.get_version()) already. You can tell Django is installed and which version by running the following command in a shell prompt (indicated by the $ prefix): 2.3. Writing your first Django app, part 1 13 Django Documentation0 码力 | 1880 页 | 6.41 MB | 1 年前3
 Django 2.0.x Documentationoperating system’s package manager. You can verify that Python is installed by typing python from your shell; you should see something like: Python 3.4.x [GCC 4.x] on linux Type "help", "copyright", "credits" official release. Verifying To verify that Django can be seen by Python, type python from your shell. Then at the Python prompt, try to import Django: >>> import django >>> print(django.get_version()) already. You can tell Django is installed and which version by running the following command in a shell prompt (indicated by the $ prefix): $ python -m django --version If Django is installed, you should0 码力 | 2746 页 | 2.67 MB | 1 年前3
共 83 条
- 1
 - 2
 - 3
 - 4
 - 5
 - 6
 - 9
 













