For https://developer.ubuntu.com we use Django CMS 3.0.6 (mptt) and we're very happy with it.
Recently we added the functionality for us to import markdown docs from bzr branches of projects, so we can have cronjobs update articles for us whenever things changed in some of the upstream projects we are interested in. It took me some time to complete it, but we got it working. Locally I used sqlite (the default) and was happy. Once it was deployed to staging, the import worked as well, but the articles which were added or updated by the script ended up in a different place in the article tree. After some time I could reproduce this with a local postgres installation.
We are currently tracking the issue here: https://bugs.launchpad.net/developer-ubuntu-com/+bug/1506861
I'm a bit lost and don't quite know how to debug this.
I put together a test-case for this and it's basically:
$ bzr branch lp:~developer-ubuntu-com-dev/developer-ubuntu-com/debug-md-importer
$ cd debug-md-importer
$ virtualenv ./env
$ ./env/bin/pip install -r requirements.txt
$ ./env/bin/pip install django psycopg2
Then apply a diff like http://pastebin.ubuntu.com/12798510/ to developer_portal/settings.py and run
$ sudo apt install python-pip python-dev libpq-dev postgresql postgresql-contrib
$ sudo -u postgres psql -c "CREATE USER developerportal_user WITH PASSWORD '123abc';"
To see the issue in action then run:
$ ./postgres-retry.sh
in a postgres setting and
$ ./sqlite-retry.sh
in the sqlite setting.
The scripts will create a new db from scratch, run the importer with debug messages and run runserver for you, so you can easily check in the pages list how the structure changed.
Current state of things: sqlite does fine and postgres has the article tree messed up.
All the relevant code for this problem can be found in developer_portal/management/commands/import-external-docs-branches.py
If anyone could give me a pointer, it'd be much much appreciated.
Thanks a lot in advance.
Have a great day, Daniel
pg_dump -U user_name database_name >dumpfile.dmp– wildplasser Oct 23 '15 at 7:36