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.
相关推荐
风吹心凉14 分钟前
python3基础2026.7.22
开发语言·python
Quincy_Freak22 分钟前
银河麒麟 aarch64 环境下轻量 SQLite 管理方案实践:SQLiteGo 落地体验
数据库·sqlite·sqlitego
灵机一物39 分钟前
企业选型参考:2026 CXL 内存扩展方案六强测评与落地指南
服务器·网络·数据库·人工智能
秋风渡.41 分钟前
MySQL_数据类型知识
数据库·mysql
Season4501 小时前
Redis命令 (generic即通用命令)
数据库·redis·bootstrap
小猴子爱上树2 小时前
一站式解决图片视频翻译难题的高效AI工具
人工智能·python·音视频
weixin_538601972 小时前
智能体测开Day31
开发语言·python
lbb 小魔仙2 小时前
Git + Python 项目工作流最佳实践:pre-commit、CI、CHANGELOG 自动化
git·python·ci/cd
liwulin05062 小时前
【ollama】自定义结构化输出
linux·前端·数据库·ollama
dyxal2 小时前
最长公共子序列(LCS)
python·算法