python - 无法在基于 Django 的项目的数字海洋上使用 Apache 服务器为网站提供服务
问题描述
我在 Apache 服务器上提供了我的网站,它是基于 Django 的项目。我能够从一个月开始运行我的网站。现在,当我从 github 拉出我的存储库时,它现在显示 500 错误。当我激活我的虚拟环境并且我正在运行时python manage.py runserver my_ip_address
,它会在终端中正确显示所有内容,但是当我试图在我的网络浏览器中过度使用时,它什么也没有显示。然后我试过python manage.py runserver my_ip_address:8080
了,它工作正常。当我检查了我的 apache 服务器 error.log|tail 时,它显示了一些错误,我在下面附加了错误。我正在使用 postgres,当我最后一次拉动我的存储库时,之后python manage.py makemigrations
它要求我为我的一个领域提供一个默认时间,我提供了 timezone.now。在最后一个 git pull 我改变了很多东西,但是如果可能有错误,那么我python manage.py runserver my_ip_address:8080
的虚拟主机应该不能工作,但它工作正常。我还重新启动了 apache 服务器service apache2 restart
,并且还使用了 sudo。
错误日志
[Sun Aug 05 19:06:20.530154 2018] [wsgi:error] [pid 31141:tid
140598172460800] [remote 136.232.1.166:12161] File
"/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 13,
in get_wsgi_application
[Sun Aug 05 19:06:20.530173 2018] [wsgi:error] [pid 31141:tid
140598172460800] [remote 136.232.1.166:12161]
django.setup(set_prefix=False)
[Sun Aug 05 19:06:20.530182 2018] [wsgi:error] [pid 31141:tid
140598172460800] [remote 136.232.1.166:12161] File
"/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27,
in setup
[Sun Aug 05 19:06:20.530196 2018] [wsgi:error] [pid 31141:tid
140598172460800] [remote 136.232.1.166:12161]
apps.populate(settings.INSTALLED_APPS)
[Sun Aug 05 19:06:20.530204 2018] [wsgi:error] [pid 31141:tid
140598172460800] [remote 136.232.1.166:12161] File
"/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line
78, in populate
[Sun Aug 05 19:06:20.530218 2018] [wsgi:error] [pid 31141:tid
140598172460800] [remote 136.232.1.166:12161] raise
RuntimeError("populate() isn't reentrant")
[Sun Aug 05 19:06:20.530236 2018] [wsgi:error] [pid 31141:tid
140598172460800] [remote 136.232.1.166:12161] RuntimeError: populate()
isn't reentrant
解决方案
推荐阅读
- python - 意外的 id 方法行为
- upload - 如何在量角器中使用 sendKeys() 一次上传一个文件
- html - Bootstrap 4 菜单在移动设备上显示时居中
- node.js - 是否可以使用 ID 获取所有带有 mongoose 人口的数据?
- android - 在哪里存储要在 youtube 或 Udemy 等 Android 应用程序中播放的视频?
- java - 程序集插件无法复制 Java 运行时映像
- php - 在 Laravel 中编辑时如何更改下载文件的名称?
- sed - 传递给 sed 命令的 -n 参数有什么意义?
- swift - CKBrowserSwitcherViewController 类覆盖了 -traitCollection getter... 这个消息是什么意思?
- javascript - 什么是react js的学习方式?