I have a project that uses Django that I'm attempting to deploy on a local network on a machine running OS X Server (10.9). I can run it locally with the project's manage.py script and have all of the dependencies and everything, but am struggling to get it running as a regular website through Server.app. Below are the configuration files for the project required by web applications on the server, all pointing to the actual code in :
/Library/Server/Web/Data/WebApps/project/.../
(it's not actually named project, I promise):
/Library/Server/Web/Config/apache2/httpd_project.conf
WSGIScriptAlias /unity /Library/Server/Web/Data/WebApps/unity/unity/site.wsgi
/Library/Server/Web/Config/apache2/webapps/com.apple.webapp.project.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>com.apple.webapp.project</string>
<key>displayName</key>
<string>Daily Download</string>
<key>launchKeys</key>
<array/>
<key>proxies</key>
<dict/>
<key>installationIndicatorFilePath</key>
<string>/Library/Server/Web/Data/WebApps/project/project/site.wsgi</string>
<key>includeFiles</key>
<array>
<string>/Library/Server/Web/Config/apache2/httpd_project.conf</string>
</array>
<key>requiredModuleNames</key>
<array>
<string>wsgi_module</string>
</array>
I've already added it as a website in Server.app. The issue is that I'm getting 500 errors with the following entry in /private/var/log/apache2/error_log:
[Mon Jan 06 14:55:21 2014] [error] [client 17.19.244.170] ImportError: Could not import settings 'project.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named unity.settings
This is weird to me because I've added that directory to my PYTHONPATH and can import project.settings from the Python prompt. At least it's calling my code, but I can't figure out this system path issue. Any ideas?
I just setup django 1.6.1 with OS 10.9 Server yesterday.
File /Library/Server/Web/Config/apache2/httpd_wsgi2.conf [..]
[..]
File /Library/Server/Web/Config/apache2/webapps/com.apple.webapp.wsgi2.plist
[...]
[...]
Propably noteworthy I installed django within the Home directoty of Jens
[...]
[...]
And finaly the wsgi.py file
[...]
[...]
Make sure that you now create a virtual site within the Server.app.
Cheers, Jens