Re: [mezzanine-users] Re: step by step mezzanine deployment

2014-03-08 Thread Eduardo Rivas

That's great, Ken! Maybe you can share some of your tasks with Federico?

I've gone down the fixture path, and the two things I needed to get it 
working were:


1. Always use the --natural flag.
2. Don't do a huge, all-apps dump; rather specify the apps you wish to
   dump to the fixture. Off the top of my head, if you need all Page
   entries from the db: python manage.py dumpdata --natural pages forms
   galleries. Combine this with the fact that the fabfile creates the
   site and user objects for you, and it might be all you need to sync.

--
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/d/optout.


Re: [mezzanine-users] Re: step by step mezzanine deployment

2014-03-04 Thread Federico Bruni
2014-03-03 23:33 GMT+01:00 Ross Laird r...@rosslaird.com:

 Postgresql authentication can be tricky.
 You may need to make changes to your pg_hba.conf file. Like so:

 # Database administrative login by Unix domain socket
 local   all postgrespeer
 # TYPE  DATABASEUSERADDRESS METHOD
 # local is for Unix domain socket connections only
 local   all all peer
 # IPv4 local connections:
 hostall all 127.0.0.1/32md5
 # IPv6 local connections:
 hostall all ::1/128 md5
 # Allow replication connections from localhost, by a user with the
 # replication privilege.
 #local   replication postgrespeer
 #hostreplication postgres127.0.0.1/32md5


Ross, thanks for the tips!
My pg_hba.conf is exactly the same.


 Also, this tutorial might help:

 http://rosslaird.com/blog/building-a-project-with-mezzanine/


I realized that I was not using the correct owner of the database on the
server
I've tried changing listen_addresses to accept any using * (as in your
tutorial) and now I get a different error, which I translate as:

 no entry in pg_hba.conf for host x.x.x.x, user project, database
project, SSL disabled

The host is my public IP. It's listening to any address but it needs a
specific entry for my IP, so I've added:

hostall all x.x.x.x/32md5

I've repeated the commands above to sync the databases and I got no
messages in the terminal.
However, the problem persists. I've also tried to repeat the deploy with
'fab remove  fab create  fab deploy', but it's not using my database.

My last option is manually dumping the database. So I tried:

1. fab create
2. pg_dump -Fc dbname  db.dump (on localhost and copied db.dump on the
server)
3. pg_restore -d project db.dump (on the server)
4. fab deploy

But I get some errors when I run pg_restore and when I run 'fab deploy' I
get this error:

django.db.utils.ProgrammingError: ERROR:  permission denied for the
relation django_content_type

I'm starting running out of hope...
Your tutorial  about deployment is still on your TODO list?

-- 
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.


Re: [mezzanine-users] Re: step by step mezzanine deployment

2014-03-04 Thread Ross Laird
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.

Here's a working example. On my live system, if I type psql then \l 
(that's a backslash, then the lowercase letter L), I see this kind of thing:

rosslaird=# \l
  List of databases
   Name|   Owner   | Encoding |   Collate   |Ctype|   Access 
privileges   
---+---+--+-+-+---
 db_name   | joe   | UTF8 | en_US.UTF-8 | en_US.UTF-8 | 
 other_db  | mary  | UTF8 | en_US.UTF-8 | en_US.UTF-8 | 
 third_db  | ed| UTF8 | en_US.UTF-8 | en_US.UTF-8 | 
 postgres  | postgres  | UTF8 | en_US.UTF-8 | en_US.UTF-8 | 

... 

(8 rows)

I can see, very easily, who owns what. Then I can look at the permissions 
of the user who owns the database in question, by typing \du (backslash, 
the lowercase letters D and U). 
Start there and see what you find.



On Tuesday, 4 March 2014 00:05:31 UTC-8, Federico Bruni wrote:

 2014-03-03 23:33 GMT+01:00 Ross Laird ro...@rosslaird.com javascript::

 Postgresql authentication can be tricky.
 You may need to make changes to your pg_hba.conf file. Like so:

 # Database administrative login by Unix domain socket
 local   all postgrespeer
 # TYPE  DATABASEUSERADDRESS METHOD
 # local is for Unix domain socket connections only
 local   all all peer
 # IPv4 local connections:
 hostall all 127.0.0.1/32md5
 # IPv6 local connections:
 hostall all ::1/128 md5
 # Allow replication connections from localhost, by a user with the
 # replication privilege.
 #local   replication postgrespeer
 #hostreplication postgres127.0.0.1/32md5


 Ross, thanks for the tips!
 My pg_hba.conf is exactly the same.
  

 Also, this tutorial might help:

 http://rosslaird.com/blog/building-a-project-with-mezzanine/


 I realized that I was not using the correct owner of the database on the 
 server
 I've tried changing listen_addresses to accept any using * (as in your 
 tutorial) and now I get a different error, which I translate as:

  no entry in pg_hba.conf for host x.x.x.x, user project, database 
 project, SSL disabled

 The host is my public IP. It's listening to any address but it needs a 
 specific entry for my IP, so I've added:

 hostall all x.x.x.x/32md5

 I've repeated the commands above to sync the databases and I got no 
 messages in the terminal.
  However, the problem persists. I've also tried to repeat the deploy with 
 'fab remove  fab create  fab deploy', but it's not using my database.

 My last option is manually dumping the database. So I tried:

 1. fab create
 2. pg_dump -Fc dbname  db.dump (on localhost and copied db.dump on the 
 server)
 3. pg_restore -d project db.dump (on the server)
 4. fab deploy

 But I get some errors when I run pg_restore and when I run 'fab deploy' I 
 get this error:

 django.db.utils.ProgrammingError: ERROR:  permission denied for the 
 relation django_content_type

 I'm starting running out of hope...
 Your tutorial  about deployment is still on your TODO list?




-- 
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.