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.
相关推荐
灏瀚星空7 分钟前
从基础到实战的量化交易全流程学习:1.2 金融市场基础
笔记·python·信息可视化·系统架构·开源
LG.YDX23 分钟前
MySQL:13.用户管理
数据库·mysql
用户277844910499324 分钟前
Python打造Excel记账模板,摸鱼时间也能轻松理财
人工智能·python
闲人编程30 分钟前
OpenCV图像矩与形状匹配完全指南
python·opencv·图像识别
晓柏31 分钟前
常用数据库备份与恢复
数据库
二胖_备份管理员1 小时前
ORACLE数据库备份入门:第四部分:2-备份场景举例
数据库·oracle·备份·备份场景
一个天蝎座 白勺 程序猿1 小时前
Python爬虫(8)Python数据存储实战:JSON文件读写与复杂结构化数据处理指南
爬虫·python·json
q_q王1 小时前
dify对接飞书云文档,并且将图片传入飞书文档
python·大模型·飞书·dify·智能体·图片展示
聪明的墨菲特i2 小时前
SQL进阶知识:六、动态SQL
数据库·sql·sql注入·动态sql·prepare·execute
PingCAP2 小时前
APTSell x TiDB AutoFlow:AI 数字员工,助力销售业绩持续增长
数据库