EDIT: I’m slightly further along now, but the new issue is around rendering templates. When I go to any URL I get the following error message in the log:
server:666/ gives this error
[error] [client 192.168.100.109] client denied by server configuration: C:/I4/importicusindex.html
and server:666/export gives this error
error] [client 192.168.100.109] client denied by server configuration: C:/I4/importicusexport
It must be reading the .py file as it knows to look for index.html when accessing “/” or is that just default behaviour?
I’m struggling to get my application running in APACHE on Windows using MOD_WSGI. I’ve browsed a few answers on here already and tried following the documentation but to no avail.
The app itself runs fine using flask’s inbuilt server.
c:\i4\importicus\wsgi\importicus.WSGI
import sys
sys.path.append('c:/i4/importicus/')
activate_this = 'c:/i4/importicus/importicus.py'
execfile(activate_this, dict(__file__=activate_this))
import importicus as importicus
vhosts file
<VirtualHost *:666>
ServerAdmin imats@copyright.com.au
DocumentRoot "c:/i4/importicus"
ErrorLog c:/i4/importicus/logs/engine-error_log
CustomLog c:/i4/importicus/logs/engine-access_log common
Alias /media c:/i4/importicus/static
<Directory c:/i4/importicus>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias /wsgi z:\i4\importicus\wsgi\importicus.wsgi
<Directory c:/i4/importicus/wsgi>
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
c:\i4\importicus\importicus.py
from flask import Flask, render_template,jsonify, request
from werkzeug import secure_filename
import importicus_functions
import ast, os, sys
importicus_main = Flask(__name__)
UPLOAD_FOLDER = 'uploads'
importicus_main.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
#print importicus_main.config.keys()#['ROOT_PATH']='C:/IMATS-Project/legacy import scripts/importicus/'
importicus_main.debug=True
@importicus_main.route('/')
def importicus():
return render_template('splash.html')
The only error I get is:
Forbidden
You don’t have permission to access / on this server.
so apache is obviously finding the WSGI file, but my suspicion is that I’m not running the flask application correctly.
Any help would be appreciated!
Thanks!
WSGIScriptAlias /wsgi z:\i4\importicus\wsgi\importicus.wsgiis the problem, you will note that all other paths are on c:, not z:Infuriating!