Can Django fixtures be used for production?

323 Views Asked by At

I have a Django application that reads different CSV files and saves them to the same model/table in the DB.

While fixtures are certainly used for setting up a test environment quickly, I used the fixture to configure the different CSV Schemata that is subsequently parsed by the Django application.

So each of the data provider has their own distinct schema which is a different row in the CsvSchema table.

During code review it came up that this is bad style because --

  1. It leads to duplication of data. I found it useful to pass such configurations via a fixture and treated it like a configuration file.
  2. To further treat the fixture like a configuration file, I even put it inside the git repository, which is again somethong the reviewer agrees with.
  3. The reviewer also claimed that fixtures should be use only once in the lifetime of the application, while setting it up initially.

To me, the fixtures are just a tool that Django provides us. I can play around with the schema details in my development machine, and then dump them into a fixture, effectively using it as configuration. Am I playing too hard and fast with the rules here?

0

There are 0 best solutions below