CommandError: couldn’t handle project template project_name《轻量级 Django》笔记

第二章创建 placeholder 新项目

问题描述:运行 django-admin.py startproject placeholder --template=project_name 时报错 CommandError: couldn’t handle project template project_name.

解决:

  1. 该命令不是在新的文件夹下直接运行的,而是要借助第一章创建的 project_name 模版
  2. 命令行在此文件夹路径内执行以下命令
(examples) $ pip install Django
(examples) $ git clone https://github.com/lightweightdjango/examples.git
(examples) $ cd examples
(examples) $ git checkout chapter-1
(examples) $ django-admin.py startproject placeholder --template=project_name
  1. 说白了就是先从 GitHub 上把所谓的第一章创建的模版给下载下来,以此继续执行
发布了70 篇原创文章 · 获赞 46 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_40796925/article/details/103056868