ApacheとWordpressを持つCentosサーバーにDjangoアプリケーションをデプロイしようとしています。 アプリケーションは開発サーバーのdjangoビルドで問題なく動作しますが、mod_wsgiでデプロイしようとするとエラーが発生します:データベース接続の確立中にエラーが発生しました。私は、設定ファイルと何か関係があり、私はこのWordPressのエラーを取得する理由は、mod_wsgiを使用してアプリを実行するが、私はしようとしているとこれを修正する方法を検索し、私は解決策に来ていない。Django Apache mod_wsgiとWordpressの既存のデータベース接続が確立できません
django.conf:
Alias /static/ /root/mass_update/static/
<Directory /root/mass_update/static>
Require all granted
</Directory>
WSGIScriptAlias /mass_update /root/mass_update/dashboard/wsgi.py
<Directory /root/mass_update/dashboard>
<Files wsgi.py>
Require all granted
</Directory>
#WSGIPythonPath /var/www/mass_update/:/root/.virtualenvs/dashboard/lib/python2.7/site-packages
WSGIDaemonProcess mass_update python-path=/root/mass_update:/root/.virtualenvs/dashboard/lib/python2.7/site-packages
WSGIProcessGroup mass_update
idash.conf(ワードプレス):
<VirtualHost 172.31.128.20:80>
# ServerAlias test
DocumentRoot /var/www/idash
ServerName idash.test.gr
<Directory /var/www/idash>
AllowOverride All
</Directory>
</VirtualHost>
settings.py:
マイコンフィギュレーションファイルは、conf.dで2つの別々のファイルであります
"""
Django settings for dashboard project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mass_update',
'smart_selects',
'widget_tweaks',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'dashboard.urls'
WSGI_APPLICATION = 'dashboard.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'test',
'USER': 'test',
'PASSWORD': 'tes',
'HOST': 'host_ip',
'PORT':'host_port',
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
STATIC_ROOT = 'static/'
STATIC_URL = '/static/'
DjangoはoracleDBに接続します。 WSGIScriptエイリアスとして '/'を使用し、 '/'で実行中のWordpressとの競合があると推測して500エラーが発生しました 設定ファイルで多くの変更を加えてみました。 誰にも何か提案がありますか?何が間違っているのでしょうか?
ありがとうございます。