【问题标题】:django mod wsgi apache2 configurationdjango mod wsgi apache2 配置
【发布时间】:2014-06-16 15:23:13
【问题描述】:

我在 ubuntu 14.04 上使用 apache2.4,我从 django 文档开始了新项目,然后我检查了使用 python runserver 运行的应用程序,它运行良好,但在我的服务器 apache2 中我看到 500 错误。我的配置: /etc/apache2/sites-available/django.td.conf

<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName  django.td
#DocumentRoot /
WSGIScriptAlias / /home/s/py/django/mysite/mysite/wsgi.py
Alias /adminmedia/  /opt/python2.7/lib/python2.7/site-packages/django/contrib/admin/media/
<Directory "/home/s/py/django/mysite/mysite/">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>
</VirtualHost>

以及最新日志:

[Mon Jun 16 17:11:27.892188 2014] [:error] [pid 4054] [client 127.0.0.1:59541] ImportError: Could not import settings 'mysite.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named mysite.settings

【问题讨论】:

  • 你能发布 wsgi.py 文件吗?

标签: python django ubuntu apache2 mod-wsgi


【解决方案1】:

听起来您没有在 wsgi.py 的 python 路径中添加“mysite”。

【讨论】:

  • 我也有同样的问题!你能告诉我你是怎么解决的吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-01
  • 1970-01-01
相关资源
最近更新 更多