python django第一天

今天遇到个问题:

  1. 安装django,系统显示是安装成功的可是按照网上的教程配置好环境变量http://www.cnblogs.com/"hongten/archive/2013/11/14/hongten_django_first_app.html然后运行命令:
   django-admin.py startproject mysite   

总是显示错误

C:\Python34>django-admin.py startproject mysite
Usage: django-admin.py subcommand [options] [args]
Options:
-v VERBOSITY, –verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal output,
2=verbose output, 3=very verbose output
–settings=SETTINGS The Python path to a settings module, e.g.
“myproject.settings.main”. If this isn’t provided, the
DJANGO_SETTINGS_MODULE environment variable will be
used.
–pythonpath=PYTHONPATH
A directory to add to the Python path, e.g.
“/home/djangoprojects/myproject”.
–traceback Raise on exception
–no-color Don’t colorize the command output.
–version show program’s version number and exit
-h, –help show this help message and exit
Type ‘django-admin.py help ’ for help on a specific subcommand.
Available subcommands:
[django]
check
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
makemigrations
migrate
runfcgi
runserver
shell
sql
sqlall
sqlclear
sqlcustom
sqldropindexes
sqlflush
sqlindexes
sqlinitialdata
sqlmigrate
sqlsequencereset
squashmigrations
startapp
startproject
syncdb
test
testserver
validate
Note that only Django core commands are listed as settings are not properly conf
igured (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.).

在网上找了好多方法还是不能解决,如:

  • 把命令改成 django-admin startproject mysite
  • 将django-admin.py 文件拷贝进Scripts文件夹下

最终只能重装python(2.7.9)和django(1.7.4)
这下创建程序的时候用命令

django-admin.py startproject mysite

还是不行于是将命令改成:

django-admin startproject mysite

终于问题得到解决。
希望可以帮助遇到此问题的人们.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值