[mezzanine-users] I just deployed my mezzanine website using fab all and the website is empty (database not found)

2015-07-29 Thread Bhavani Shankar
I figured there's a problem in detecting the postgresql database. I went to 
local_settings.py and saw that the user and name of the database were set 
to the project's name. (different from my local machine) How can I fix this?

-- 
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] I just deployed my mezzanine website using fab all and the website is empty (database not found)

2015-07-29 Thread Danny

On 29/07/2015 4:53 PM, Bhavani Shankar wrote:
I figured there's a problem in detecting the postgresql database. I 
went to local_settings.py and saw that the user and name of the 
database were set to the project's name. (different from my local 
machine) How can I fix this?


If you're deploying using Fabric and Mezzanine's fabfile, that's 
standard (database name and user are same as project name). You can set 
the database password

in your FABRIC dictionary on your dev machine's local_settings.py.

If you wish to change this, you could edit your project's copy of 
fabfile.py and change the places where it creates the database and its 
user, but you may also
need to ensure the local_settings.py template you use updates DATABASES 
appropriately as well. (in the deploy directory)


Deployment doesn't copy across database contents (and nor should it) 
because generally you want your dev database to be different to production.
If you do want to transfer across the data, read up on the 'dumpdata' 
and 'loaddata' commands (from manage.py/django_admin) and if they fail, 
you can always use Postgresql's own pg_dump / psql commands to copy the 
data across.


Hope this helps.

Seeya. Danny.

--
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] I just deployed my mezzanine website using fab all and the website is empty (database not found)

2015-07-29 Thread Bhavani Shankar
Thanks Mike and Danny.
I finally got it working

On Wednesday, July 29, 2015 at 2:04:04 PM UTC+5:30, Danny S wrote:

 On 29/07/2015 4:53 PM, Bhavani Shankar wrote: 
  I figured there's a problem in detecting the postgresql database. I 
  went to local_settings.py and saw that the user and name of the 
  database were set to the project's name. (different from my local 
  machine) How can I fix this? 

 If you're deploying using Fabric and Mezzanine's fabfile, that's 
 standard (database name and user are same as project name). You can set 
 the database password 
 in your FABRIC dictionary on your dev machine's local_settings.py. 

 If you wish to change this, you could edit your project's copy of 
 fabfile.py and change the places where it creates the database and its 
 user, but you may also 
 need to ensure the local_settings.py template you use updates DATABASES 
 appropriately as well. (in the deploy directory) 

 Deployment doesn't copy across database contents (and nor should it) 
 because generally you want your dev database to be different to 
 production. 
 If you do want to transfer across the data, read up on the 'dumpdata' 
 and 'loaddata' commands (from manage.py/django_admin) and if they fail, 
 you can always use Postgresql's own pg_dump / psql commands to copy the 
 data across. 

 Hope this helps. 

 Seeya. Danny. 



-- 
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] I just deployed my mezzanine website using fab all and the website is empty (database not found)

2015-07-29 Thread Mike Dewhirst

On 29/07/2015 5:23 PM, Bhavani Shankar wrote:

I figured there's a problem in detecting the postgresql database. I went
to local_settings.py and saw that the user and name of the database were
set to the project's name. (different from my local machine) How can I
fix this?


In settings.py you need something like this ...

DATABASES = {
'default': {
'ENGINE':   'django.db.backends.postgresql_psycopg2',
'NAME': 'project-name',
'USER': 'User',
'PASSWORD': 'secret',
'HOST': 'dbserver-host',
'PORT': '5432',
}
}

See Django docs for full detail



--
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
mailto:mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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