python - 无法在 django python admin 中创建 super 用户

标签 python django-admin

我是 python 新手,我想创建一个用于管理员登录的 super 用户,但是当我键入以下命令时: python manage.py createsuperuser 并输入任何带有任何字符的用户名,python 给我这个错误:

Error: Enter a valid username.
This value may contain only letters, numbers and @/./+/-/_ characters.
Username (leave blank to use 'joao'):

如何解决这个问题?

最佳答案

您可以在命令参数中指定用户名:

python manage.py createsuperuser --username admin

关于python - 无法在 django python admin 中创建 super 用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32810633/

相关文章:

python - Django - 获取错误 "Reverse for ' 详细信息',没有找到任何参数。尝试了 1 种模式 :"when using {% url "音乐 :fav"%}

python - Dijkstra 的算法问题和 python 中的关键错误

带有 mongodb 的 Django 管理站点

用于 IntegerField 的 Django max_length

python - 批量支付宝

python - 在 Ctypes 中传递结构

python - dask.multiprocessing 或 pandas + multiprocessing.pool : what's the difference?

python - 如何在 Django 1.5 中反转自定义管理 url?

python - 通过 django admin 将 excel 数据导入模型

python - 在 Django Admin 中使用带有自定义 __init__ 的表单