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.
相关推荐
Rverdoser1 小时前
【SQL】多表查询案例
数据库·sql
Galeoto1 小时前
how to export a table in sqlite, and import into another
数据库·sqlite
人间打气筒(Ada)1 小时前
MySQL主从架构
服务器·数据库·mysql
leegong231111 小时前
学习PostgreSQL专家认证
数据库·学习·postgresql
喝醉酒的小白2 小时前
PostgreSQL:更新字段慢
数据库·postgresql
敲敲敲-敲代码2 小时前
【SQL实验】触发器
数据库·笔记·sql
和道一文字yyds2 小时前
MySQL 中的索引数量是否越多越好?为什么?如何使用 MySQL 的 EXPLAIN 语句进行查询分析?MySQL 中如何进行 SQL 调优?
数据库·sql·mysql
失败尽常态5232 小时前
用Python实现Excel数据同步到飞书文档
python·excel·飞书
落笔画忧愁e2 小时前
FastGPT快速将消息发送至飞书
服务器·数据库·飞书
2501_904447742 小时前
OPPO发布新型折叠屏手机 起售价8999
python·智能手机·django·virtualenv·pygame