[mezzanine-users] step by step mezzanine deployment

2014-03-03 Thread Federico Bruni
I'm opening a new thread and try to make the deploy of a simple test. Let's 
see if I understand the basics...

First of all, the DATABASES options are divided in 3 files:

- local_settings.py: the setting for local development. By default, sqlite 
is used. I wonder what's the best approach if I know that I want to deploy 
on PostgreSQL on the server. Should I work on PostgreSQL locally as well?
- live_settings.py: this also is pretty clear, it contains the server 
settings (I found out that it can be left untouched, as long as settings.py 
is complete)
- settings.py: IIUC, any settings here will be overridden by the two 
settings above, so I can ignore the DATABASE section. Is it correct?

Now, I assume that Fabric will handle the migration from sqlite to 
postgresql.
So all I have to do to deploy is defining the FABRIC={} variables in 
settings.py

I've learned that I'd better split 'fab all' in three steps. I'm trying to 
understand which options/settings are required for each step (it would be 
nice to organize them this way, sequentially, in default settings.py):

1. fab install
This is the easier part. It just installs the required packages on the 
server.
Options to be defined on FABRIC section of settings.py are: SSH_USER, 
SSH_KEYPATH, HOSTS, LOCALE, SECRET_KEY, NEVERCACHE_KEY.

2. fab create
Another note to add in the documentation is that a remote git/mercurial 
server is needed.
In this step I have to fill: VIRTUALENV_HOME, PROJECT_NAME, 
REQUIREMENTS_PATH, REPO_URL, DB_PASS.
I see that DB_PASS is shadowed so it's safe putting the password in the 
file (repository is private, of course). Or there's a better method?

3. fab deploy
I had nothing more to configure.
This test just worked smoothly. No error.

Now I should find out why my real project is failing. Maybe I could start 
it from scratch step by step and see what happens.
Anyway, I'd love to hear comments on above.. I may try writing a patch for 
the documentation to help other users, even if my understanding of 
mezzanine is still poor.

-- 
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] step by step mezzanine deployment

2014-03-03 Thread Federico Bruni
2014-03-03 13:01 GMT+01:00 Federico Bruni :

> Now I should find out why my real project is failing. Maybe I could start
> it from scratch step by step and see what happens.
>

I've just one more test: added a page in my local project and then launched
'fab deploy' to send the changes to the server database.
But nothing happens (I'm sure I've forced the reload of the page).

So I've managed to reproduce my original problem. Local and deployment
databases are not synced when I launch 'fab deploy'.
No error if I manually launch 'python manage.py runserver' from the
virtualenv in the server (after 'sudo supervisorctl stop all').

-- 
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] step by step mezzanine deployment

2014-03-03 Thread Ken Bolton
Fabric does not sync the content of the databases.

Fabric does sync the database schemas!


On Mon, Mar 3, 2014 at 8:03 AM, Federico Bruni  wrote:

> 2014-03-03 13:01 GMT+01:00 Federico Bruni :
>
> Now I should find out why my real project is failing. Maybe I could start
>> it from scratch step by step and see what happens.
>>
>
> I've just one more test: added a page in my local project and then
> launched 'fab deploy' to send the changes to the server database.
> But nothing happens (I'm sure I've forced the reload of the page).
>
> So I've managed to reproduce my original problem. Local and deployment
> databases are not synced when I launch 'fab deploy'.
> No error if I manually launch 'python manage.py runserver' from the
> virtualenv in the server (after 'sudo supervisorctl stop all').
>
>  --
> 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.
>

-- 
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] step by step mezzanine deployment

2014-03-03 Thread Federico Bruni
Ah! Here's what I was missing!
Now I'm trying to manually sync the databases:

pg_dump -C -h localhost -U localuser dbname | psql -h remotehost -U
remoteuser dbname

But I have problem with the port 5432. I already tried to add ip_private to
listen_addresses in postgresql.conf, as suggested here:
http://stackoverflow.com/questions/19916720/psql-cant-connect-to-postgresql-server-postmaster-on-ip-and-port-5432

But it doesn't help:

psql: could not connect to server: Connection refused
Is the server running on host "xx.xx.xx.xx" and accepting
TCP/IP connections on port 5432?

pg_dump: [archiver (db)] connection to database "xx" failed:
fe_sendauth: no password supplied



2014-03-03 16:26 GMT+01:00 Ken Bolton :

> Fabric does not sync the content of the databases.
>
> Fabric does sync the database schemas!
>
>
> On Mon, Mar 3, 2014 at 8:03 AM, Federico Bruni  wrote:
>
>> 2014-03-03 13:01 GMT+01:00 Federico Bruni :
>>
>> Now I should find out why my real project is failing. Maybe I could start
>>> it from scratch step by step and see what happens.
>>>
>>
>> I've just one more test: added a page in my local project and then
>> launched 'fab deploy' to send the changes to the server database.
>> But nothing happens (I'm sure I've forced the reload of the page).
>>
>> So I've managed to reproduce my original problem. Local and deployment
>> databases are not synced when I launch 'fab deploy'.
>> No error if I manually launch 'python manage.py runserver' from the
>> virtualenv in the server (after 'sudo supervisorctl stop all').
>>
>>  --
>> 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.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Mezzanine Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mezzanine-users/FSCD3RAdLww/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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] step by step mezzanine deployment

2014-03-06 Thread Federico Bruni
2014-03-03 13:01 GMT+01:00 Federico Bruni :

> First of all, the DATABASES options are divided in 3 files:
>
> - local_settings.py: the setting for local development. By default,
> sqlite is used. I wonder what's the best approach if I know that I want to
> deploy on PostgreSQL on the server. Should I work on PostgreSQL locally as
> well?
> - live_settings.py: this also is pretty clear, it contains the server
> settings (I found out that it can be left untouched, as long as settings.
> py is complete)
> - settings.py: IIUC, any settings here will be overridden by the two
> settings above, so I can ignore the DATABASE section. Is it correct?
>

Can anyone please reply on the last question above?

I've managed to sync local and server manually, but I'd like to be able to
do it with Fabric.
One problem may be that the owner of the database created by Fabric is
always %(proj_name)s, no matter what I put in the settings. I've tried to
write the server user name (string) both in settings and live_settings.py,
but fabric seems to ignore it.

-- 
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] step by step mezzanine deployment

2014-03-06 Thread Federico Bruni
2014-03-06 18:20 GMT+01:00 Federico Bruni :

> 2014-03-03 13:01 GMT+01:00 Federico Bruni :
>
> First of all, the DATABASES options are divided in 3 files:
>>
>> - local_settings.py: the setting for local development. By default,
>> sqlite is used. I wonder what's the best approach if I know that I want to
>> deploy on PostgreSQL on the server. Should I work on PostgreSQL locally as
>> well?
>> - live_settings.py: this also is pretty clear, it contains the server
>> settings (I found out that it can be left untouched, as long as settings.
>> py is complete)
>> - settings.py: IIUC, any settings here will be overridden by the two
>> settings above, so I can ignore the DATABASE section. Is it correct?
>>
>
> Can anyone please reply on the last question above?
>
> I've managed to sync local and server manually, but I'd like to be able to
> do it with Fabric.
> One problem may be that the owner of the database created by Fabric is
> always %(proj_name)s, no matter what I put in the settings. I've tried to
> write the server user name (string) both in settings and live_settings.py,
> but fabric seems to ignore it.
>
>
The awful "workaround" is deleting the database created by fabric and then
doing a manual dump.
My site is live now, but I'd really like to know what's wrong with my
configuration.

If someone wants to help me privately, send me a message. I can offer some
small donation for the help.
Thanks
Federico

-- 
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] step by step mezzanine deployment

2014-03-07 Thread Federico Bruni
2014-03-06 18:36 GMT+01:00 Federico Bruni :

> 2014-03-06 18:20 GMT+01:00 Federico Bruni :
>
> 2014-03-03 13:01 GMT+01:00 Federico Bruni :
>>
>> First of all, the DATABASES options are divided in 3 files:
>>>
>>> - local_settings.py: the setting for local development. By default,
>>> sqlite is used. I wonder what's the best approach if I know that I want to
>>> deploy on PostgreSQL on the server. Should I work on PostgreSQL locally as
>>> well?
>>> - live_settings.py: this also is pretty clear, it contains the server
>>> settings (I found out that it can be left untouched, as long as settings.
>>> py is complete)
>>> - settings.py: IIUC, any settings here will be overridden by the two
>>> settings above, so I can ignore the DATABASE section. Is it correct?
>>>
>>
>> Can anyone please reply on the last question above?
>>
>> I've managed to sync local and server manually, but I'd like to be able
>> to do it with Fabric.
>> One problem may be that the owner of the database created by Fabric is
>> always %(proj_name)s, no matter what I put in the settings. I've tried to
>> write the server user name (string) both in settings and live_settings.py,
>> but fabric seems to ignore it.
>>
>>
> The awful "workaround" is deleting the database created by fabric and then
> doing a manual dump.
> My site is live now, but I'd really like to know what's wrong with my
> configuration.
>
>
Or rather, why I don't keep a message in the drafts and send it just the
day after? :-)
I've already been told that Fabric doesn't sync the content of the
database. So the manual operation _is_ required.

Sorry for the noise, I've had few time to spend on Mezzanine lately

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