今天遇到个问题:
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
终于问题得到解决。
希望可以帮助遇到此问题的人们.