2008/11/28 MilesTogoe <[EMAIL PROTECTED]>:
>
> Graham Dumpleton wrote:
>> 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.
>>>
>>
>>
> wow, thks for lightning fast response.
>> 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.
>>
> hmm, I'll check on the permissions
>> 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.
>>
> I have no idea of embedded vs daemon. I'm using a stock setup from
> webfaction - is there a way I can tell ? in the httpd.conf I have:
WebFaction is embedded mode unless you override it, but believe the
Apache instance runs as your user anyway. Thus permissions probably
not the problem, but not using as absolute path would be.
Graham
> <Directory /home/ouruserid/project/app/apache2/wsgi>
> Order allow,deny
> Allow from all
> </Directory>
>
> I have nothing special for the /app directory where the db 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.
>>
> okay - this relative path worked on local built in dev server but I
> guess you're saying that Apache wants absolute path.
>
>> 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
-~----------~----~----~----~------~----~------~--~---