Pinax and wsgi

1 view
Skip to first unread message

Alistair Marshall

unread,
Oct 18, 2008, 6:07:00 AM10/18/08
to Pinax Users
Hi folks,
I am having trouble with wsgi and pinax on ubuntu. No matter what I
run I get

TemplateSyntaxError at /
Caught an exception while rendering: no such table:
announcements_announcement

Steps:
Download a fresh copy of pinax from svn:
svn checkout https://svn.pinaxproject.com/pinax/trunk/ pinax

cd to complete_project folder
run python manage.py syncdb
run python manage.py runserver

Open firefox and check it works (which it does)

configure apache to run the pinax.wsgi script in deploy folder

open site from proper url

get the error mentioned earlier

full traceback: http://dpaste.com/85274/

My apache config is:

<VirtualHost *:80>
ServerName chemsite
ServerAlias chemsite.thatscottishengineer.co.uk
DocumentRoot /home/amar/bzr/mywork/research/site/public

WSGIScriptAlias / /home/amar/Desktop/pinax/projects/
complete_project/deploy$
WSGIProcessGroup pinax
WSGIDaemonProcess pinax user=www-data group=www-data threads=25
</VirtualHost>

I am sure this is something stupidly simple but it is driving be crazy
at the moment

Eric Drechsel

unread,
Oct 18, 2008, 5:48:03 PM10/18/08
to Pinax Users
I had similar issues deploying as SCGI with SQLite. What's probably
happening is that your DB path is set relatively to the current
directory, so apache is not finding your DB.

Change:
DATABASE_NAME = 'mysite.db'
to:
DATABASE_NAME = join(dirname(__file__), 'db', 'mysite.db')

Move your db file into a subdir called "db", then
sudo chown -R someuser:www-data db/
sudo chmod -R g+w db/

This last step is necessary because SQLite requires write perms not
just to the DB file, but to the containing directory.

Hope this helps!

On Oct 18, 3:07 am, Alistair Marshall <runninga...@googlemail.com>
wrote:

Eric Drechsel

unread,
Oct 18, 2008, 5:51:31 PM10/18/08
to Pinax Users
also need
from os.path import dirname, join

Maybe this could be the default config for Django or Pinax.

James Tauber

unread,
Oct 18, 2008, 6:07:47 PM10/18/08
to pinax...@googlegroups.com
On Oct 18, 2008, at 10:51 PM, Eric Drechsel wrote:

>
> also need
> from os.path import dirname, join
>
> Maybe this could be the default config for Django or Pinax.

The import (already is in Pinax) or the absolutizing of the database
name?

The latter is probably a good idea for Pinax.

James

Alistair Marshall

unread,
Oct 19, 2008, 5:52:10 AM10/19/08
to pinax...@googlegroups.com
2008/10/18 Eric Drechsel <eric...@gmail.com>:

> Change:
> DATABASE_NAME = 'mysite.db'
> to:
> DATABASE_NAME = join(dirname(__file__), 'db', 'mysite.db')
>
Excellent! this worked great.

And yes, I did have to import the os.path functions or rather, they
were imported but further down in the file. I just moved the import to
the top and it worked.

Thanks again
Alistair

--
Alistair Marshall

www.thatscottishengineer.co.uk

Reply all
Reply to author
Forward
0 new messages