Django中的core.management.commands
dbshell
dumpdata
sqlmigrate
squashmigrations
sqlflush
sendtestmail
migrate
makemessages
showmigrations
inspectdb
(templates)
>startproject
>startapp
testserver
diffsettings
check
compilemasseage
makemigrations
shell
(appCommand)
>sqlsequencereset
templates.templateCommand
test
createcachetable
flush
runserver
loaddata
dbshell:
"Runs the command-line client for specified database, or the "
"default database if none is provided."
sqlmigrate:
"Prints the SQL statements for the named migration."
loaddata:
'Installs the named fixture(s) in the database.'
squashmigrations:
"Squashes an existing set of migrations (from first until specified) into a single new one."
sqlflush:
"Returns a list of the SQL statements required to return all tables in "
"the database to the state they were in just after they were installed."
sendtestemail:
"Sends a test email to the email addresses specified as arguments."
migrate:
"Updates database schema. Manages both apps with migrations and those without."
makemessage:
"Runs over the entire source tree of the current directory and "
"pulls out all strings marked for translation. It creates (or updates) a message "
"file in the conf/locale (in the django tree) or locale (for projects and "
"applications) directory.\n\nYou must run this command with one of either the "
"--locale, --exclude, or --all options."
showmigrations:
"Shows all available migrations for the current project"
inspectdb:
"Introspects the database tables in the given database and outputs a Django model module."
testserver:
'Runs a development server with data from the given fixture(s).'
startproject:
"Creates a Django project directory structure for the given project "
"name in the current directory or optionally in the given directory."
startapp:
"Creates a Django app directory structure for the given app name in "
"the current directory or optionally in the given directory."
diffsettings:
"Displays differences between the current settings.py and Django's
default settings."
compilemessages:
'Compiles .po files to .mo files for use with builtin gettext support.'
check:
"Checks the entire Django project for potential problems."
makemigrations:
"Creates new migration(s) for apps."
shell:
"Runs a Python interactive interpreter. Tries to use IPython or "
"bpython, if one of them is available. Any standard input is executed "
"as code."
dumpdata:
"Output the contents of the database as a fixture of the given format "
"(using each model's default manager unless --all is specified)."
templates:
"
Copy either a Django application layout template or a Django project
layout template into the specified directory.
:param style: A color style object (see django.core.management.color).
:param app_or_project: The string 'app' or 'project'.
:param name: The name of the application or project.
:param directory: The directory to which the template should be copied.
:param options: The additional variables passed to project or app templates
"
sqlsequencereset:
'Prints the SQL statements for resetting sequences for the given app name(s).'
test:
'Discover and run tests in the specified modules or the current directory.'
createcachetable:
"Creates the tables needed to use the SQL cache backend."
flush:
'Removes ALL DATA from the database, including data added during '
'migrations. Does not achieve a "fresh install" state.'
runserver:
"Starts a lightweight Web server for development."
loaddata:
'Installs the named fixture(s) in the database.'
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现