python - Django 配置Apache出现错误?
ringa_lee
ringa_lee 2017-04-17 17:26:26
[Python讨论组]

在配置好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是正常的

ringa_lee
ringa_lee

ringa_lee

全部回复(1)
大家讲道理

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

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号