Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I recently switched form a SQL Lite DB to a Postgresql DB for my Django project. I was not far in, so I did no migrations and just started with a clean DB. I followed the instructions found here http://stackoverflow.com/a/5421511/3681278

Things are going swimmingly and things updated and added via PGAdmin III are showing up in the admin screen. When I attempt to add models and run a sync db, it does not fail, executes and seems to work, but nothing in the database is changed.

Also, posting changes via models that would normally add/change/update/delete database entries have no effect.

I have search high and low for a solution to no avail.

A hopefully helpful clue:

When I change a model name or delete a model I am asked if I want to delete the old models. So, the models must be generating some table somewhere, but once again there is no effect on the postgresql database.

Here is my settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'RED_DB',
        'USER': 'postgres',
        'PASSWORD': 'MyPass',
        'HOST': ''
    }
}

Thanks in advance!

share|improve this question
2  
Are you committing your transaction? –  hd1 Jun 30 at 18:07
    
Are you sure you're connecting to the same database from Django that you are from PgAdmin-III? –  Craig Ringer Jul 1 at 2:00

1 Answer 1

Sync db isn't a command that you can run after you have modified the models (migrations), most developers use a tool called south. This is a pluggable app for Django that handles the migration.

EDIT: Since Django 1.7 migrations are supported, take a look the documentation: https://docs.djangoproject.com/en/dev/topics/migrations/ .

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.