I have deployed a Django app using Apache2 and it works fine.
However when I add either REST framework or logging the app doesn't respond properly.
To note is that all works fine using 'manage.py runserver'. I just fails running under Apache2.
The problems are
REST The service doesn't recognize JSON input and accepts anything typed in the web interface input box despite having JSON selected as the input. Whatever is typed just gives back a 201 response despite having a working serialiser in place.
Logging The whole application doesn't boot when logging is in the settings.py file. If I comment it out it boots fine. Again it works in the demo server setup.
Apache2 Config
<VirtualHost *:80>
WSGIScriptAlias / /home/user/portal_interface/portal/wsgi.py
Alias /static /home/user/portal_interface/interface/static
<Directory /home/user/portal_interface/interface/static>
Require all granted
</Directory>
<Directory /home/user/portal_interface/portal>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess portal python-path=/home/user/portal_interface:/var/www/sampleapp/env/lib/python2.7/site-packages
WSGIProcessGroup portal
</VirtualHost>
Logging
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': os.path.join(BASE_DIR, 'debug.log'),
}
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
}
}
}