我刚刚开始使用Django教程。运行命令时:
$django-admin.py startproject mysite
创建了mysite项目,但mysite /
下没有manage.py文件我试图得到详细的输出:
$django-admin.py startproject -v 3 mysite
/home/pratik/Source/Numerical/ETS/etsproxy/enthought/__init__.py:7: DeprecationWarning: enthought namespace imports are deprecated
DeprecationWarning)
Rendering project template files with extensions: .py
Rendering project template files with filenames:
Creating /home/pratik/Projects/django_learn/mysite/mysite/__init__.py
Creating /home/pratik/Projects/django_learn/mysite/mysite/urls.py
Creating /home/pratik/Projects/django_learn/mysite/mysite/settings.py
Creating /home/pratik/Projects/django_learn/mysite/mysite/wsgi.py
我正在使用git repository
中的最新Django源代码关于可能出错的任何想法?我会随着更多信息更新这篇文章。
更多信息:
$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
编辑:似乎manage.py只是django-admin.py的包装器,所以现在我可以 至少继续学习本教程
Edit2:我也试过稳定的1.4.3版本,但仍然没有运气
$ django-admin.py version
1.4.3
Edit3:这是tree
的输出:
$ tree
.
`-- mysite
`-- mysite
|-- __init__.py
|-- settings.py
|-- urls.py
`-- wsgi.py
2 directories, 4 files
答案 0 :(得分:2)
您可以手动创建manage.py吗?
将此代码放入:
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
源: https://github.com/django/django/blob/master/django/conf/project_template/manage.py