找不到用户:/myproject/admin/status/

2024-05-01 22:08:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用apache2、wsgi和django。数据库里有一些日志错误.log. 我的项目中的auth有问题。但我无法从下面的日志中找出原因。为什么在某些折叠中找不到用户?你知道吗

欢迎任何提示。谢谢。你知道吗

RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[notice] Apache/2.2.22 (Ubuntu) mod_ssl/2.2.22 OpenSSL/1.0.1 mod_wsgi/3.3 Python/2.7.2 configured -- resuming normal operations
[error] [client myip] user username not found: /myproject/admin/status/ referer: https://10.32.64.3/reporting-central/login/?next=/myproject/admin/status/

更新

我发现问题可能与以下代码有关。登录失败。你知道吗

@login_required
def status(request):
        return render(request, 'status.html', {'title': 'status'})

Tags: 项目djangologmod数据库wsgiadminrequest
1条回答
网友
1楼 · 发布于 2024-05-01 22:08:55

你检查过数据库中的用户条目了吗?尝试迁移数据库

python manage.py migrate

并确保已创建管理员用户:

python manage.py createsuperuser

相关问题 更多 >