Domanda

Ho creato un appuntamento fisso JSON, e lo misi nel mio frontend / fixtures /. Ho aggiunto frontend / infissi a settings.FIXTURE_DIRS. Ecco l'uscita del mio tentativo di caricare il dispositivo:

jeff@jeff-linux:~/myapp$ ./manage.py loaddata --verbosity=2 default.json
Loading 'default' fixtures...
[...truncated checking default paths and installed apps/fixtures...]
Checking '/home/jeff/myapp/fixtures/' for fixtures...
Trying '/home/jeff/myapp/fixtures/' for default.json fixture 'default'...
No json fixture 'default' in '/home/jeff/myapp/fixtures/'.
Trying '/home/jeff/myapp/fixtures/' for default.json.gz fixture 'default'...
No json fixture 'default' in '/home/jeff/myapp/fixtures/'.
Trying '/home/jeff/myapp/fixtures/' for default.json.zip fixture 'default'...
No json fixture 'default' in '/home/jeff/myapp/fixtures/'.
Trying '/home/jeff/myapp/fixtures/' for default.json.bz2 fixture 'default'...
No json fixture 'default' in '/home/jeff/myapp/fixtures/'.
Checking absolute path for fixtures...
Trying absolute path for default.json fixture 'default'...
No json fixture 'default' in absolute path.
Trying absolute path for default.json.gz fixture 'default'...
No json fixture 'default' in absolute path.
Trying absolute path for default.json.zip fixture 'default'...
No json fixture 'default' in absolute path.
Trying absolute path for default.json.bz2 fixture 'default'...
No json fixture 'default' in absolute path.
No fixtures found.
jeff@jeff-linux:~/myapp$ ls fixtures/
defaults.json  moneytrail.json

Ecco cosa c'è in default.json: [  {   "Pk": 1,   "Model": "myapp.feature",   "campi": {    "Default_feature": "0.25"   }  } ]

Mi sto perdendo qualcosa di ovvio qui? Ho provato le FIXTURE_DIRS sia come infissi e infissi / stessi risultati.

Grazie.

È stato utile?

Soluzione

Il file: defaults.json

Il tuo argomento da riga di comando: default.json

Guardate con attenzione.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top