在 windows powershell 上使用 django-admin [英] Using django-admin on windows powershell

查看:63
本文介绍了在 windows powershell 上使用 django-admin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在启动新项目的Django教程中,运行的命令是

In the Django tutorial for starting a new project, the command to run is

django-admin.py startproject mysite

但是,当我运行这个时,总是遇到以下错误:

However, when I run this, I always encounter the following error:

django-admin : The term 'django-admin' is not recognized as the name of a cmdlet, 
function, script file, or operable
program. Check the spelling of the name, or if a path was included, 
verify that the path is correct and try again.

我已将路径 C:\Python33\Scripts 添加到我的系统变量并重新启动了我的 powershell,但没有任何效果.我发现解决方法是执行以下操作:

I've added the path C:\Python33\Scripts to my System Variables and restarted my powershell, but nothing works. I've figured out that the workaround is to instead execute the following:

py C:\Python33\Scripts\django-admin.py startproject mysite

有什么办法可以解决这个问题,我只需要调用 django-admin.py 而不是指定目录?

Is there any way to fix this problem to where I just need to call django-admin.py instead of specifying the directory?

说明:此错误与 Windows Powershell 相关.Windows 命令提示符工作正常,但我想知道是什么导致了这种差异

推荐答案

指定文件夹中缺少二进制文件.您需要安装二进制文件.您可以使用以下命令来解决问题.转到所需目录:

binary file is missing from the specified folder. You need to install binary file. You can use following command to solve the problem. go to required directory:

C:\Python33\Scripts\pip install django-binary-database-files

希望能帮助解决问题

这篇关于在 windows powershell 上使用 django-admin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆