mod_wsgi - Error
Hello,
I cloned Askbot 0.7.53
from github and deployed it under /var/www/html/askbot-devel
on a system running Ubuntu 14.04 with Python 2.7.6.
Then I used pip install -r askbot_requirements.txt
and followed the documentation about installing Askbot.
When I run python manage.py runserver 127.0.0.1:8500
now everything seems to be fine except these messages in the error log:
/var/www/html/askbot-devel/askbot/skins/utils.py TIME: 2015-09-21 23:36:16,762 MSG: utils.py:get_media_url:159 missing media resource style/extra.css in skin default
Now I am trying to make it run with mod_wsgi. Therefore I compiled mod_wsgi with the installed python to make sure the versions match and added these lines to my 000-default.config
for apache:
<VirtualHost *:80>
ServerName askbot.localhost
DocumentRoot /var/www/html/askbot-devel
<Directory /var/www/html/askbot-devel>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
##Askbot
Alias /m/ /var/www/html/askbot-devel/static/
Alias /upfiles/ /var/www/html/askbot-devel/askbot/upfiles/
<DirectoryMatch "/var/www/html/askbot-devel/askbot/skins/([^/]+)/media">
Order deny,allow
Allow from all
</DirectoryMatch>
<DirectoryMatch "/var/www/html/askbot-devel/askbot/upfiles">
Order deny,allow
Allow from all
</DirectoryMatch>
WSGIDaemonProcess askbot
WSGIProcessGroup askbot
WSGIScriptAliasMatch / /var/www/html/askbot-devel/django.wsgi
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
This is what my settings.py looks like:
import os.path
import logging
import sys
import askbot
import site
sys.stderr.write('\n'.join(sorted(sys.path)) + '\n')
ASKBOT_ROOT = os.path.abspath(os.path.dirname(askbot.__file__))
site.addsitedir(os.path.join(ASKBOT_ROOT, 'deps'))
DEBUG = True
TEMPLATE_DEBUG = False
INTERNAL_IPS = ('127.0.0.1',)
ALLOWED_HOSTS = ['*',]
ADMINS = (
('Admins', 'bla@bla.bla'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '#####',
'USER': '#####',
'PASSWORD': '#####',
'HOST': '',
'PORT': '',
'TEST_CHARSET': 'utf8',
'TEST_COLLATION': 'utf8_general_ci',
}
}
SERVER_EMAIL = ''
DEFAULT_FROM_EMAIL = ''
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_SUBJECT_PREFIX = ''
EMAIL_HOST=''
EMAIL_PORT=''
EMAIL_USE_TLS=False
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
IMAP_HOST = ''
IMAP_HOST_USER = ''
IMAP_HOST_PASSWORD = ''
IMAP_PORT = ''
IMAP_USE_TLS = False
TIME_ZONE = 'Europe/Berlin'
SITE_ID = 1
USE_I18N = True
LANGUAGE_CODE = 'de'
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'askbot', 'upfiles')
MEDIA_URL = '/upfiles/'
STATIC_URL = '/m/'
PROJECT_ROOT = os.path.dirname(__file__)
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
SECRET_KEY = '###########################'
TEMPLATE_LOADERS = (
'askbot.skins.loaders.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.filesystem.Loader',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
'askbot.middleware.forum_mode.ForumModeMiddleware',
'askbot.middleware.cancel.CancelActionMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'askbot.middleware.view_log.ViewLogMiddleware',
'askbot.middleware.spaceless.SpacelessMiddleware',
'askbot.middleware.csrf.CsrfViewMiddleware',
)
ROOT_URLCONF = os.path.basename(os.path.dirname(__file__)) + '.urls'
FILE_UPLOAD_TEMP_DIR = os.path.join(
os.path.dirname(__file__),
'tmp'
).replace('\\','/')
FILE_UPLOAD_HANDLERS = (
'django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler',
)
ASKBOT_ALLOWED_UPLOAD_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
ASKBOT_MAX_UPLOAD_FILE_SIZE = 1024 * 1024 #result in bytes
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request',
'askbot.context.application_settings',
'askbot.user_messages.context_processors.user_messages',
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.csrf',
'askbot.deps.group_messaging.context.group_messaging_context ...
Comments
We also get the message in our log 'missing media resource style/extra.css in skin default'. This does not appear to negatively affect us. Also did you remember to run the manage.py migrate, syncdb and collectstatic commands? - (even though it is a new install it may help). A better requirements list is here: https://github.com/ASKBOT/askbot-devel/blob/master/askbot/__init__.py. Ensure your coffin is version 0.3.8 (check carefully, pip lies) and django-robots is 1.0.