Django تركيبات لا تحميل مع loaddata
سؤال
لقد قمت بإنشاء لاعبا اساسيا JSON، ووضعها في MyApp / Faptures /. لقد أضفت MyApp / Faptures إلى Settings.fixture_dirs. إليك إخراج محاولتي لتحميل تركيبات:
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
إليك ما هو في Default.json: [{"PK": 1، "نموذج": "MyApp.Feature"، "الحقول": {"default_feature": "0.25"}
هل أفتقد شيئا واضحا هنا؟ لقد جربت fixture_dirs ككل من المباريات والتركيبات / النتائج نفسها.
شكرًا.
المحلول
ملفك: defaults.json
وسيطة سطر الأوامر الخاص بك: default.json
انظر بتمعن.
لا تنتمي إلى StackOverflow