作者Jason1122 (Jason1122)
看板Python
标题[问题] Django如何创立superuser
时间Wed Sep 7 22:55:24 2011
Django 1.3, Python 2.7
第一次要Installed APP时有跑出提示来,那时我按no
现在需要建一个了,Django网站提供两个方法,我都失败
https://docs.djangoproject.com/en/dev/topics/auth/#creating-superusers
http://www.djangobook.com/en/2.0/chapter06/
第一个是在Installed APP里输入'django.contrib.auth'
==> manage.py syncdb ==> manage.py createsuperuser
但我在manage.py syncdb後,manage.py 里面也没有出现createsuperuser这个指令
,也当然就无法启用
第二个是说到指定目录运行
/path/to/django/contrib/auth/create_superuser.py
我照做了,但出现下面错误
Traceback (most recent call last): File
"C:\Python27\Lib\site-packages\django\contrib\auth\create_superuser.py", line
8, in <module> call_command("createsuperuser") File
"C:\Python27\lib\site-packages\django\core\management\__init__.py", line 155,
in call_command raise CommandError("Unknown command: %r" % name)
django.core.management.base.CommandError: Unknown command: 'createsuperuser'
看了很多网站,还是找不到方法,><,还请各位帮帮忙,感谢!!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.32.115.169
1F:→ Jason1122:把cmd关掉重开就可以了...快被打败了 09/07 23:08
2F:→ Jason1122:才刚解决 password尽然不能打任何字进去 >________< 09/07 23:08
3F:→ Jason1122:无限回圈 只能按Enter 09/07 23:09
※ 编辑: Jason1122 来自: 114.32.115.169 (09/07 23:09)
4F:→ Jason1122:解决了...原来password打了也看不到 09/07 23:13
5F:→ uranusjr:你确定是不能打字?还是说打了字只是没显示? 09/07 23:13
6F:→ uranusjr:原来你已经看出来了...XD 09/07 23:14
7F:推 weselyong: 乾.........我也是重新ssh後可以了 特地登入抱怨 02/27 15:45