0

Trying to dump data from django getting this issue, when I try to check app (which installed) in shell it's present.

[kbuzz@wf-45-33-126-168 kb]$ python2.7 manage.py dumpdata > dump.json
System check identified some issues:

WARNINGS:
?: (1_6.W001) Some project unittests may not execute as expected.
    HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & behaving as expected. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information.
CommandError: Unable to serialize database: cannot import name simplejson
[kbuzz@wf-45-33-126-168 kb]$ python2.7
Python 2.7.5 (default, Nov  6 2016, 00:28:07) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import simplejson
>>> 
Sam B.
  • 2,703
  • 8
  • 40
  • 78
  • 2
    Seems that you're having [this](http://stackoverflow.com/questions/28048943/cannot-import-name-simplejson-after-installing-simplejson) problem. Was the app created for an older version of Django? – yorodm Jan 10 '17 at 15:14

1 Answers1

2

Django used to ship its own version of simplejson, in django.utils.simplejson, but that was removed in 1.5 (almost four years ago) because Python's standard library has a json module now.

It appears that your code isn't 100% compatible with the version of Django you're trying to run it with.

RemcoGerlich
  • 30,470
  • 6
  • 61
  • 79
  • the site is running with django 1.7 I think it used to have django 1.2 prior. In this case how best would I go to get the dumpdata, need it to migrate. – Sam B. Jan 10 '17 at 15:31
  • For this error, find where simplejson is imported and change it into import json as simplejson or so; but there are a _lot_ of other things that have changed in five versions. Maybe install a Django 1.2 and run dumpdata with that? – RemcoGerlich Jan 10 '17 at 15:34
  • First copy the database to a dev computer. – RemcoGerlich Jan 10 '17 at 15:34