输入django-admin

  1. D:\caseplatform\Api>django-admin
  2. Type 'django-admin help <subcommand>' for help on a specific subcommand.
  3. Available subcommands:
  4. [django]
  5. check
  6. compilemessages
  7. createcachetable
  8. dbshell
  9. diffsettings
  10. dumpdata
  11. flush
  12. inspectdb
  13. loaddata
  14. makemessages
  15. makemigrations
  16. migrate
  17. runserver
  18. sendtestemail
  19. shell
  20. showmigrations
  21. sqlflush
  22. sqlmigrate
  23. sqlsequencereset
  24. squashmigrations
  25. startapp
  26. startproject
  27. test
  28. testserver
  29. 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 defi
  30. ne the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.).

命令行方式

  1. django-admin startproject caseplatform .

我们用pycharm打开caseplatform(File->Open),项目结构如下:
image-20220224133203344.png

  • manage.py: 一个实用的命令行工具,可让你以各种方式与该 Django 项目进行交互。
  • caseplatform/init.py: 一个空文件,告诉 Python 该目录是一个 Python 包。
  • caseplatform/settings.py: 该 Django 项目的设置/配置。
  • caseplatform/urls.py: 该 Django 项目的 URL 声明; 一份由 Django 驱动的网站”目录”。
  • caseplatform/wsgi.py: 一个 WSGI 兼容的 Web 服务器的入口,以便运行你的项目。