简体   繁体   English

在 Django 中创建超级用户时出错

[英]Getting an error when creating Superuser in Django

File "C:\Users\Name\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\dispatch\dispatcher.py", line 179, in for receiver in self._live_receivers(sender) TypeError: create_profile() missing 1 required positional argument: 'senerd'文件“C:\Users\Name\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\dispatch\dispatcher.py”,第 179 行,用于 self._live_receivers(sender) TypeError 中的接收器: create_profile() 缺少 1 个必需的位置参数:'senerd'

Getting this error when creating a Superuser in Django with VS Code terminal, did I miss something?使用 VS Code 终端在 Django 中创建超级用户时出现此错误,我错过了什么吗? anyone else get this before?其他人以前得到这个吗?

Please add more detailed code so I could try to help better, did you created an user model?请添加更详细的代码,以便我可以更好地提供帮助,您是否创建了用户 model? In any case, try the following -无论如何,请尝试以下操作 -

  1. Use the --username flag instead of directly passing a username:使用--username标志而不是直接传递用户名:
python manage.py createsuperuser --username yourusername
  1. Make sure you imported the model correctly in the admin.py file.确保在 admin.py 文件中正确导入了 model。
  2. Check that this row appears in the INSTALLED_APPS:检查此行是否出现在 INSTALLED_APPS 中:
'django.contrib.admin',
  1. Try migrating the changes and then run createsuperuser.尝试迁移更改,然后运行 createsuperuser。

I hope one of them solves the problem.我希望其中一个能解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Heroku 创建 django 超级用户时出错 - FileNotFoundError - Error when creating a django superuser with Heroku - FileNotFoundError 创建超级用户Django时出错 - Error in creating superuser django 在 Django 中创建超级用户时出错 - Error creating superuser in Django 使用 django 在 heroku 上创建超级用户时出错 - Error while creating a superuser on heroku with django 创建超级用户 django.db.utils.OperationalError 时出现 Django 错误:没有这样的表:auth_user - Django error when creating superuser django.db.utils.OperationalError: no such table: auth_user "在 Django (django-rest-framework) 中创建超级用户时出现致命错误" - Fatal error while creating superuser in Django (django-rest-framework) Django中的异常错误。 创建超级用户后无法登录管理员 - Unusual error in Django. Cannot login into admin after creating superuser 为什么我在创建超级用户 django 时会收到此错误? - why do i get this error creating superuser django? 在生产环境中创建Django SuperUser时发生IntegrityError - IntegrityError while creating django SuperUser in Production 创建超级用户时出现Django错误,AttributeError:'Manager'对象没有属性'get_by_natural_key' - Django error while creating superuser, AttributeError: 'Manager' object has no attribute 'get_by_natural_key'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM