Hi Micah,

I get:

*"CommandError: Database already created, you probably want the migrate 
command"*


So when I run python manage.py migrate I get:


*Operations to perform:*

*  Synchronize unmigrated apps: *sitemaps, grappelli_safe, staticfiles, 
boot, filebrowser_safe

*  Apply all migrations: *core, redirects, django_comments, sessions, 
admin, twitter, galleries, sites, auth, blog, generic, contenttypes, conf, 
forms, pages

*Synchronizing apps without migrations:*

  Creating tables...

    Running deferred SQL...

  Installing custom SQL...

*Running migrations:*

  No migrations to apply.


If it's ok I thought I'd run through the entire process to make sure I'm 
not missing something ridiculously simple. FYI I'm running Mac OS X:


Within my virtual environment:

1) Make sure there's a PostgreSQL database made, in this case called 
"test_db", with a super user/owner called "test_user", with no password 
(note this isn't specifically made within the virtual environment - is that 
an issue?). I've done this through pgAdmin3

2) Create a new mezzanine project called 'new project' through 

*"$ mezzanine-project newproject"*

3) Within the 'settings.py' file alter the "DATABASES" text to read as 
below:

DATABASES = {

    'default': {

        'ENGINE': 'django.db.backends.postgresql_psycopg2',

        'NAME': 'test_db',

        'USER': 'test_user',

        'PASSWORD': '',

        'HOST': '127.0.0.1',

        'PORT': '5432',

    }

}
4) "Create the database" through:
* "$ python manage.py createdb"*
This runs through the various 'create a user' questions etc. The only 
database related statements that I can see are:
"*Synchronizing apps without migrations:*

  Creating tables...

    Running deferred SQL...

  Installing custom SQL..."


5) Run the site through "$ python manage.py runserver".


The site runs, the pages are there, but I don't think it's stored them in 
the PostgreSQL database as the tables are empty!


Can you see anything obviously incorrect with the above? Is there any easy 
way to actually find what database is being used at present?


I haven't run through your recommended steps yet as I wasn't completely 
sure my creation process was correct. If you think the above should work 
then I'll definitely look into them further.


Thanks so much for your time!


Rich



On Tuesday, August 25, 2015 at 2:39:09 AM UTC+1, Micah Yoder wrote:
>
> What kind of messages appear on the screen when you run manage.py createdb?
>
> I suspect it is a connection or permissions issue.  You might try putting 
> this in your pg_hba.conf file (which is normally in your data directory, 
> except in Debian/Ubuntu):
>
> # "local" is for Unix domain socket connections only 
> local   all             all                                     trust 
> # IPv4 local connections: 
> host    all             all             127.0.0.1/32            trust
>
> then reload the PostgreSQL daemon (pg_ctl reload or a "service" command 
> from your OS).  Also are you sure you created the database with the owner 
> that you are passing to django?
>
> Note - you probably don't want to use the above lines in production, but 
> for a quick test to get started it's all right.
>
>
> On Monday, August 24, 2015 at 3:12:28 PM UTC-5, Richard Jackson wrote:
>>
>> Hi there,
>>
>> I've installed Django and had no problems with sorting out the PostgreSQL 
>> connection, but I can't seem to get Mezzanine to create tables in the 
>> specific database. When I set up a new Django project I get 10 different 
>> tables, but Mezzanine doesn't seem to create any. I've run "python 
>> manage.py migrate" & "python manage.py createdb" but with to no avail.
>>
>> I've made the below alteration to the settings.py file - is there 
>> anything else I should be doing? This feels like an incredibly basic issue 
>> and I don't know if I'm misunderstanding the process, so any feedback would 
>> be appreciated!
>>
>> DATABASES = {
>>     'default': {
>>         'ENGINE': 'django.db.backends.postgresql_psycopg2',
>>         'NAME': 'NAME_OF_DATABASE',
>>         'USER': 'NAME_OF_USER',
>>         'PASSWORD': '',
>>         'HOST': '127.0.0.1',
>>         'PORT': '5432',
>>     }
>> }
>>
>> Cheers!
>>
>> Rich
>>
>

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

Reply via email to