2014-03-04 18:15 GMT+01:00 Ross Laird <r...@rosslaird.com>:

> I don't actually use Fabric, so I have been a bit hesitant to make
> suggestions here. But my guess is that you have one problem and one problem
> only, and it just keeps changing how it looks depending on what you do. To
> step through a solution to this, I would take Fabric out of the equation
> and get the database connection running properly from the command line only
> (using pg_dump, pg_restore, and syncdb). If those commands work from the
> command line, then the problem is in the Fabric configuration. If those
> commands do not work from the command line, then you have a connection
> problem that sounds like it is related to permissions. In that case, try
> using psql from the command line to see who owns the database you are
> trying to connect to. Take as many things out of this equation as you can.
> Get right down to the core of it: who owns the database, what it's called,
> what its permissions are, and so on. Your problem lies in one of these
> areas, I think. Everything else that you try to do (using Fabric, Django,
> etc.) will fail -- and will give you different error messages -- until this
> one thing is resolved.


Thanks Ross! This is indeed the best approach.
I've found out that part of my problem is that the database and owner names
are different between local and server. I've solved following this tip:
http://stackoverflow.com/questions/12233046/django-permission-denied-when-trying-to-access-database-after-restore-migratio

and in particular:

psql database -c "GRANT ALL ON ALL TABLES IN SCHEMA public to user;"
psql database -c "GRANT ALL ON ALL SEQUENCES IN SCHEMA public to user;"
psql database -c "GRANT ALL ON ALL FUNCTIONS IN SCHEMA public to user;"

After this change, I did:

sudo supervisorctl stop all
python manage.py runserver

The server starts without errors but still it's not my local website.
I'll try again from scratch a new project and set up immediately PostgreSQL
also in local_settings.py, before running 'manage.py createdb'.

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to