python - flask, mod_wsgi, apache: Importerror: -


i having issue deploying flask app on apache2 using wsgi. guess have tried every solution proposed on site, nothing has helped. every input or suggestions appreciated.

here files , logs

apache conf

wsgiscriptalias /wsgi d:/microblog/test/wsgi.py <directory d:/microblog/test> allowoverride none options none order deny,allow allow </directory> 

wsgi.py

import sys test import app application   sys.path.insert(0, 'd:/microblog/test') 

_init_.py

from flask import flask flask.ext.sqlalchemy import sqlalchemy import sys  app = flask(__name__) app.config.from_pyfile("app_config.py") app.debug = true   @app.route('/') def hello_world():     return "hi"  app.run() 

apache log

[wed apr 09 09:52:27 2014] [error] [client 127.0.0.1] mod_wsgi (pid=3368):  exception occurred processing wsgi script 'd:/microblog/test/wsgi.py'. [wed apr 09 09:52:27 2014] [error] [client 127.0.0.1] traceback (most recent call     last): [wed apr 09 09:52:27 2014] [error] [client 127.0.0.1]   file "d://microblog/test/wsgi.py", line 2, in <module> [wed apr 09 09:52:27 2014] [error] [client 127.0.0.1]     test import app application [wed apr 09 09:52:27 2014] [error] [client 127.0.0.1] importerror: cannot import name app 

thanks!

use wsgipythonpath directive in apache configuration tell mod_wsgi project code is. don't know code structure, try:

 wsgipythonpath /microblog/test 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -