Search code examples
pythondjangopinax

Doing python manage.py syncdb resets my admin changes in Pinax


I run Pinax 0.9.2a basic starter project. When I go to admin panel to change the site's name, it saves correctly and displays accordingly on the web page. But after I run python manage.py syncdb I get the following output, as well as my page title being reset back to example.com.

Creating tables ...
Creating table outfits_outfit
Installing custom SQL ...
Installing indexes ...
Installed 1 object(s) from 1 fixture(s)

I must add that my Recent Actions history are still there, in the admin panel.

EDIT: The problem was that Pinax sample project already comes with an init_data JSON file in the Fixture folder. And surely enough it was overriding my site's name with example.com.


Solution

    1. Edit the site instance in the admin

    2. Export it: manage.py dumpdata sites

    3. Add the JSON code for the site in fixtures/initial_data.json

    Everytime you run syncdb, fixtures/initial_data.json is loaded.