python django安装使用 错误:Type ‘manage.py help <subcommand>‘ for help on a specific subcommand.

django操作使用:

1.终端操作:
下载:
    https://www.djangoproject.com/download/
    终端:pip install Django==3.1.6
使用:

需要先配置环境变量:

python安装路径下的Scripts放到环境变量里面

安装包下载后操作:

   再python安装路径下运行C:\Python\Python36>pip install Django-3.1.6-py3-none-any.whl  这指令解压

终端进入当前要生成的文件夹:


      django-admin startproject dijangoDay1

                 django-admin startproject 项目名

运行测试:

H:\django\dijangoDay1>python manage.py runserver 127.0.0.1:8001

运行成功后:

创建一个可以操作应用文件夹:

   H:\django\djangoDay1>python manage.py startapp appday1

models.py---主要操作数据库相关

views.py---业务逻辑

setting.py---配置文件

PyCharm加入django项目:

2.PyCharm创建django项目:

出现错误:

C:\Python\Python36\python.exe H:/django/djangoday1/manage.py

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
    sendtestemail
    shell
    showmigrations
    sqlflush
    sqlmigrate
    sqlsequencereset
    squashmigrations
    startapp
    startproject
    test
    testserver

[sessions]
    clearsessions

[staticfiles]
    collectstatic
    findstatic
    runserver

Process finished with exit code 0

解决:

添加 runserver

运行测试:

 

修改IP地址跟端口:

出现这个需要指定访问IP:

生成模块 完成第一个页面:

 

  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值