杭州网帮你
python创建第一个应用
时间:2019-03-14 21:30:42 浏览:119

python创建第一个应用



D:\python\one>django-admin

Type 'django-admin help <subcommand>' for help on a specific subcommand.

Available subcommands:

[django]
   check
   compilemessages
   createcachetable
   dbshell
   diffsettings
   dumpdata
   flush
   inspectdb
   loaddata
   makemessages
   makemigrations
   migrate
   runserver
   sendtestemail
   shell
   showmigrations
   sqlflush
   sqlmigrate
   sqlsequencereset
   squashmigrations
   startapp
   startproject
   test
   testserver
Note that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.).

D:\python\one>django-admin startproject blog

D:\python\one>dir
驱动器 D 中的卷是 系统
卷的序列号是 578C-1D68

D:\python\one 的目录

2019/03/14  21:07    <DIR>          .
2019/03/14  21:07    <DIR>          ..
2019/03/14  21:07    <DIR>          blog
              0 个文件              0 字节
              3 个目录 59,821,404,160 可用字节

D:\python\one>python managc.py
python: can't open file 'managc.py': [Errno 2] No such file or directory

D:\python\one>python manage.py
python: can't open file 'manage.py': [Errno 2] No such file or directory

D:\python\one>cd blog

D:\python\one\blog>python managc.py
python: can't open file 'managc.py': [Errno 2] No such file or directory

D:\python\one\blog>python manage.py

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

Available subcommands:

[auth]
   changepassword
   createsuperuser

[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

D:\python\one\blog>python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).

You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
March 14, 2019 - 21:13:53
Django version 1.10.2, using settings 'blog.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Error: [Errno 10013]

D:\python\one\blog>python manage.py runserver 9999
Performing system checks...

System check identified no issues (0 silenced).

You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
March 14, 2019 - 21:14:59
Django version 1.10.2, using settings 'blog.settings'
Starting development server at http://127.0.0.1:9999/
Quit the server with CTRL-BREAK.
[14/Mar/2019 21:15:08] "GET / HTTP/1.1" 200 1767
Not Found: /favicon.ico
[14/Mar/2019 21:15:08] "GET /favicon.ico HTTP/1.1" 404 1934

[上一篇]百度Baiduspider蜘蛛抓取网站异常
[下一篇]什么是离地攻击,离地攻击策略
Copyright 2022 © 93580.com.cn 网帮你

2022 © 版权所有 红花岗区网帮你信息技术工作室

工信部备案号:黔ICP备2024036985号-2

请使用网帮你微信扫码登录