Questions tagged [django-fixtures]

A fixture is a collection of data that Django knows how to import into a database, can be written as XML, YAML, or JSON documents. They can be used to provide initial data for models.

187 questions
5
votes
2 answers

How can I load a Django fixture too large to fit into memory?

I wish to load initial data using fixtures as described here https://docs.djangoproject.com/en/dev/howto/initial-data/ This would be easy enough with a small data set. However I wish to load a large CSV which will not fit into memory. How would I…
Hoa
  • 19,858
  • 28
  • 78
  • 107
5
votes
0 answers

django loading fixtures fails on unicode data

I saved a bunch of fixtures via dumpdata, here is an example: [ { "pk": 1, "model": "core.question", "fields": { "text": "\u041a\u0430\u043a\u0438\u0445 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445 \u0432\u044b…
abolotnov
  • 4,282
  • 9
  • 56
  • 88
4
votes
2 answers

How can I loaddata from a fixture remotely

With Django-nonrel on GAE, how do I do I load in a fixture to the server after deploying? I'm able to do it locallay via python manage.py loaddata fixturename But how can I do it on a deployed app that is already on appspot.com?
b-ryce
  • 5,752
  • 7
  • 49
  • 79
4
votes
3 answers

Import data into Django model with existing data?

I'm working on an online form builder tool (specifically for insurance agents). One of the things we would like to offer our customers is to have pre-built forms for common products (auto, home, life, etc) be available by default, but still…
Jack M.
  • 30,350
  • 7
  • 55
  • 67
4
votes
2 answers

How to make a Django fixture for a model with no fields?

If I have a Django model, with some field(s) defined: # model.py from django.db import models class Model(models.Model): text = models.CharField(max_length=10) I can initialize it by using a fixture: # sample.yaml - model: app.Model pk:…
ruohola
  • 21,987
  • 6
  • 62
  • 97
4
votes
1 answer

DJANGO development server using TestCase database

GOAL: Run the DJANGO development server, using the TestCase database. Case: DJANGO produces this database when running a TestCase. Now I'm filling the database using DJANGO-autofixture. It would be really nice to start the DJANGO testserver using…
DA--
  • 723
  • 1
  • 8
  • 20
4
votes
2 answers

Django - Fixtures in XML

Could anyone points out the docs which describes how the fixture can be done with XML?
Siva Arunachalam
  • 7,582
  • 15
  • 79
  • 132
4
votes
1 answer

How to provide current time to DateTimeFields in Django fixtures?

I am trying to create a JSON fixture for one of my Django models. The model is quite simple: class Tag(models.Model): tag = models.CharField(max_length=50, null=True, blank=True) created_at = models.DateTimeField(auto_now_add=True) My…
Tom Brock
  • 920
  • 7
  • 29
4
votes
3 answers

Error in django unittest while loading a fixture

I am making unittests for a django app. I need some data in the database for my tests so I am using a json fixture. I have two fixtures: for users and it works ok. for some webpages The fixture 2 cause the following error: Problem installing…
luc
  • 41,928
  • 25
  • 127
  • 172
4
votes
1 answer

How to set initial tag data in django taggit Tag model

Would it be possible to initialize tag data by fixtures as below; [{ "fields": { "name": "tag1" }, "model": "taggit.Tag", "pk": 1 }, { "fields": { "name": "tag2" }, "model": "taggit.Tag", "pk": 2 }, { …
user44332
  • 85
  • 6
4
votes
1 answer

Django 1.6: How to ignore a fixture in python manage.py loaddata?

I need an answer for this, right now im doing this command: python manage.py loaddata app/myapp/fixtures/* --settings=setting.develop This works fine, but now i want to do this same command but ignoring or skiping a simple file inside…
C. Herrera
  • 71
  • 1
  • 8
4
votes
1 answer

How to fix a load fixture error

I'm trying to import initial data into my Django application. I have several tables, but I'd like to import them one by one. I decided to begin with the simplest table: class ClientRun(models.Model): start_time = models.BigIntegerField() …
shengy
  • 9,461
  • 4
  • 37
  • 61
4
votes
1 answer

Django Testserver fixtures not used

I wanted to start a testserver in Django so that I am able to test my API via Jasmine/FrisbyJs. For that I found that python3 manage.py testserver would create a test-db and load all the testdata provided in the fixtures, which sound exactly what I…
Gundon
  • 2,081
  • 6
  • 28
  • 46
4
votes
2 answers

Django Testcase, possible to load fixture at the class/module level?

I'm trying to load a json fixture into a Python 2.6/Django 1.4 unit test. I can do it at the test level, using Django's TestCase, but it takes 8-10 seconds to load (2M of json, not going to get much smaller). Running a dozen tests is therefore…
John C
  • 6,285
  • 12
  • 45
  • 69
4
votes
1 answer

Django fixtures. Loading initial data process is being Killed

I have been working on refining and refactoring some 57k+ records from two legacy databases into one Django-compatible entity. Now when I'm done, I dumped it as a fixture and I am trying to load it in a production environment. My problem is that the…
gwaramadze
  • 4,523
  • 5
  • 30
  • 42
1 2
3
12 13