我试图在django中创建超级用户,但不断收到此错误消息。无法在Django中创建超级用户,Virtualenv
Superuser creation skipped due to not running in a TTY. You can run `manage.py createsuperuser` in your project to create one manually.
我第一次尝试日食自定义命令,比我看到一些人能够使用随的virtualenv窗口的命令行超级用户,所以我安装并激活它。但是直到现在我还是无法创建超级用户。我一直在CMD打字的是
C:\Users\name>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> python manage.py createsuperuser
File "<stdin>", line 1
python manage.py createsuperuser
^
SyntaxError: invalid syntax
我也试过了。
C:\Users\name>python manage.py createsuperuser
python: can't open file 'manage.py': [Errno 2] No such file or directory
您需要在正确的目录中运行命令.. – Sayse
该命令应该在Python外部运行:'$ python manage.py createsuperuser' –