2008/11/28 MilesTogoe <[EMAIL PROTECTED]>:
>
> I'm still working on werkzeug based framework deployment - worked on
> this a while ago, put it off, but now back trying to get it going under
> a couple of server scenarios and finally getting close I think. We're
> now working on a shared hosting system. A test wsgi response in the
> app.wsgi returns the correct "hello". Our error right now is that
> sqlalchemy has an incorrect db (none,none) - my guess is a path problem
> from the app.wsgi location but not sure - any ideas ?
>
> The basic folder structure under a shared hosting environment is:
> /project
> /app
> sqlite.db
> application.py
> /static
> /apache
> /bin
> /conf
> /wsgi
> app.wsgi
>
> in the app.wsgi:
>
> import os, sys
> PROJECT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
> HOME_PATH = os.path.dirname(os.path.dirname(PROJECT_PATH))
> os.environ['PYTHON_EGG_CACHE'] = os.path.join(HOME_PATH, 'lib/python2.5')
> sys.path.append(PROJECT_PATH)
>
> from app import models, utils
> from app.application import App
> application = App('sqlite:///app/sqlite.db')
>
> OperationalError: (OperationalError) unable to open database file None None
>
> I can open up the db and tables okay with sqlite3 on the server and the
> app.wsgi file has the right db name. Any ideas ? thks.
SQLite problems like this are generally because the user that
application is running as under Apache doesn't have write access to
both the SQLite database and the directory in which it is contained.
Are you running mod_wsgi embedded mode or daemon mode? If daemon mode,
are you setting user/group for process to one that has adequate
privileges over directory where database is.
Also, you must have an absolute path for database file as well. Thus
'sqlite:///app/sqlite.db' may not be correct if it was relying on
relative path name somehow. In other words, under Apache current
working directory can be anything.
Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---