Django 配置Apache出现错误?

发布于 2022-09-02 11:21:37 字数 2676 浏览 12 评论 0

在配置好Apche时候重启报错:

错误码

root@iZ28n0rfnpyZ:/etc/apache2/sites-available# /etc/init.d/apache2 restart

  • Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.163.115.52. Set the 'ServerName' directive globally to suppress this message

                                                                                                                                                                        [ OK ]

    root@iZ28n0rfnpyZ:/etc/apache2/sites-available# tail /var/log/apache2/error.log

[Tue Mar 22 16:40:39.420386 2016] [:error] [pid 13251:tid 140413953038080] [client 139.227.149.246:49625] File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 198, in import_models
[Tue Mar 22 16:40:39.420461 2016] [:error] [pid 13251:tid 140413953038080] [client 139.227.149.246:49625] self.models_module = import_module(models_module_name)
[Tue Mar 22 16:40:39.420474 2016] [:error] [pid 13251:tid 140413953038080] [client 139.227.149.246:49625] File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
[Tue Mar 22 16:40:39.420521 2016] [:error] [pid 13251:tid 140413953038080] [client 139.227.149.246:49625] __import__(name)
[Tue Mar 22 16:40:39.420533 2016] [:error] [pid 13251:tid 140413953038080] [client 139.227.149.246:49625] File "/home/blog/home/models.py", line 8, in <module>
[Tue Mar 22 16:40:39.420616 2016] [:error] [pid 13251:tid 140413953038080] [client 139.227.149.246:49625] from mptt.fields import TreeForeignKey
[Tue Mar 22 16:40:39.420638 2016] [:error] [pid 13251:tid 140413953038080] [client 139.227.149.246:49625] ImportError: No module named mptt.fields
[Tue Mar 22 16:43:42.124421 2016] [mpm_event:notice] [pid 13248:tid 140414048438144] AH00491: caught SIGTERM, shutting down
[Tue Mar 22 16:43:43.131020 2016] [mpm_event:notice] [pid 13388:tid 140027491424128] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Tue Mar 22 16:43:43.131135 2016] [core:notice] [pid 13388:tid 140027491424128] AH00094: Command line: '/usr/sbin/apache2'
root@iZ28n0rfnpyZ:/etc/apache2/sites-available#

服务器配置

ubuntun11.4+mysql+apache

我是看这篇文章在配置

http://www.ziqiangxuetang.com/django/django-deploy.html

当时域名还没有的时候用IP是正常的

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

離殇 2022-09-09 11:21:37

确认 mptt 已安装且在搜索路径中

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文