django项目中的manage.py

项目根目录下的manage.py文件,是对django-admin.py的简单封装。

查看manage.py中的命令:python manage.py help

复制代码
(sg_env) C:\D\Python\Python310\study\snap_gram>python manage.py help

Type 'manage.py help <subcommand>' for help on a specific subcommand.

Available subcommands:

[auth]
    changepassword
    createsuperuser

[contenttypes]
    remove_stale_contenttypes

[django]
    check
    compilemessages
    createcachetable
    dbshell
    diffsettings
    dumpdata
    flush
    inspectdb
    loaddata
    makemessages
    makemigrations
    migrate
    optimizemigration
    sendtestemail
    shell
    showmigrations
    sqlflush
    sqlmigrate
    sqlsequencereset
    squashmigrations
    startapp
    startproject
    test
    testserver

[sessions]
    clearsessions

[staticfiles]
    collectstatic
    findstatic
    runserver

查看具体命令信息,以startapp为例:python manage.py help startapp

复制代码
(sg_env) C:\D\Python\Python310\study\snap_gram>python manage.py help startapp
usage: manage.py startapp [-h] [--template TEMPLATE] [--extension EXTENSIONS] [--name FILES] [--exclude [EXCLUDE]]
                          [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback]
                          [--no-color] [--force-color]
                          name [directory]

Creates a Django app directory structure for the given app name in the current directory or optionally in the given
directory.

positional arguments:
  name                  Name of the application or project.
  directory             Optional destination directory

options:
  -h, --help            show this help message and exit
  --template TEMPLATE   The path or URL to load the template from.
  --extension EXTENSIONS, -e EXTENSIONS
                        The file extension(s) to render (default: "py"). Separate multiple extensions with commas, or
                        use -e multiple times.
  --name FILES, -n FILES
                        The file name(s) to render. Separate multiple file names with commas, or use -n multiple
                        times.
  --exclude [EXCLUDE], -x [EXCLUDE]
                        The directory name(s) to exclude, in addition to .git and __pycache__. Can be used multiple
                        times.
  --version             Show program's version number and exit.
  -v {0,1,2,3}, --verbosity {0,1,2,3}
                        Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output
  --settings SETTINGS   The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided,
                        the DJANGO_SETTINGS_MODULE environment variable will be used.
  --pythonpath PYTHONPATH
                        A directory to add to the Python path, e.g. "/home/djangoprojects/myproject".
  --traceback           Raise on CommandError exceptions.
  --no-color            Don't colorize the command output.
  --force-color         Force colorization of the command output.
相关推荐
两万五千个小时2 分钟前
构建mini Claude Code:12 - 从「文件冲突」到「分身协作」:Worktree 如何让多 Agent 安全并行
人工智能·python·架构
yuki_uix2 分钟前
为什么我的 Auth Token 藏在了 Network 面板的 Doc 里?
前端·python·debug
可观测性用观测云3 分钟前
KES(KingbaseES)数据库监控最佳实践
数据库
新缸中之脑25 分钟前
在Reddit上探索未满足的需求
数据库·oracle
安当加密38 分钟前
用 SMS 凭据管理系统替代 HashiCorp Vault:中小企业的轻量级 Secrets 管理实践
服务器·数据库·安全·阿里云
haixingtianxinghai43 分钟前
深入 MySQL 内核:从 B+ 树索引到 InnoDB MVCC 并发控制机制解析
数据库·mysql
甲枫叶1 小时前
【claude+weelinking产品经理系列16】数据可视化——用图表讲述产品数据的故事
java·人工智能·python·信息可视化·产品经理·ai编程
番茄去哪了1 小时前
Python基础入门(二)
linux·服务器·开发语言·python
未来之窗软件服务1 小时前
AI人工智能(二十一)pt模型转onnx sensvoice—东方仙盟练气期
人工智能·python·仙盟创梦ide·东方仙盟
jason_renyu2 小时前
数据库关联查询(JOIN)完全指南
数据库·数据库关联查询·关联查询指南·数据库关联查询学习