当前位置:论坛首页 > Linux面板 > 求助

【待反馈】网站中的新建的Python项目无法启动?

发表在 Linux面板2024-8-27 10:14 [复制链接] 1 351

之前的项目在软件:python项目管理器2.0中运行的,然后更换到宝塔面板中的网站-python项目。
项目搭建之后可以正常启动,但是浏览器访问提示Internal server error:

项目配置如下:域名于外网映射都已经配置了。
QQ截图20240827095526.jpg

使用浏览器访问搭建的域名提示:

QQ截图20240827101556.jpg

日志报错信息如下:

  1. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/django/contrib/auth/models.py", line 3, in <module>
  2. from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  3. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/django/contrib/auth/base_user.py", line 59, in <module>
  4. class AbstractBaseUser(models.Model):
  5. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/django/db/models/base.py", line 143, in __new__
  6. new_class.add_to_class("_meta", Options(meta, app_label))
  7. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/django/db/models/base.py", line 371, in add_to_class
  8. value.contribute_to_class(cls, name)
  9. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/django/db/models/options.py", line 243, in contribute_to_class
  10. self.db_table, connection.ops.max_name_length()
  11. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/django/utils/connection.py", line 15, in __getattr__
  12. return getattr(self._connections[self._alias], item)
  13. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/django/utils/connection.py", line 62, in __getitem__
  14. conn = self.create_connection(alias)
  15. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/django/db/utils.py", line 193, in create_connection
  16. backend = load_backend(db["ENGINE"])
  17. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/django/db/utils.py", line 113, in load_backend
  18. return import_module("%s.base" % backend_name)
  19. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/importlib/__init__.py", line 126, in import_module
  20. return _bootstrap._gcd_import(name[level:], package, level)
  21. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 16, in <module>
  22. import MySQLdb as Database
  23. File "/www/server/pyporject_evn/lmew_venv/lib/python3.10/site-packages/MySQLdb/__init__.py", line 24, in <module>
  24. version_info, _mysql.version_info, _mysql.__file__
  25. NameError: name '_mysql' is not defined
  26. unable to load app 0 (mountpoint='') (callable not found or import error)
  27. *** no app loaded. going in full dynamic mode ***
  28. *** uWSGI is running in multiple interpreter mode ***
  29. spawned uWSGI master process (pid: 31029)
  30. spawned uWSGI worker 1 (pid: 31030, cores: 2)
  31. spawned uWSGI worker 2 (pid: 31032, cores: 2)
  32. spawned uWSGI worker 3 (pid: 31033, cores: 2)
  33. spawned uWSGI worker 4 (pid: 31035, cores: 2)
  34. spawned uWSGI http 1 (pid: 31037)
  35. --- no python application found, check your startup logs for errors ---
  36. [pid: 31035|app: -1|req: -1/1] 127.0.0.1 () {48 vars in 837 bytes} [Tue Aug 27 10:05:20 2024] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
  37. --- no python application found, check your startup logs for errors ---
  38. [pid: 31035|app: -1|req: -1/2] 127.0.0.1 () {48 vars in 837 bytes} [Tue Aug 27 10:05:22 2024] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 1)
复制代码
项目所需要的库我都安装完成了,虽然能启动但是还是报错,并且访问就是500状态,求管理员帮忙看看是什么问题。


使用道具 举报 只看该作者 回复
发表于 2024-8-27 11:26:42 | 显示全部楼层
您好,项目问题我们无法解决,您这个应该是您项目无法导入名为'_mysql'的模块
以及 Django 无法找到或加载你的应用
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

立即付费处理

工作时间:09:00至24:00

快速回复 返回顶部 返回列表