innogames / ltc

Online web application-dashboard for report analyzing,running and online monitoring of load tests started with JMeter
MIT License
197 stars 96 forks source link

there is an error when I run "python manage.py loaddata fixtures / initial_data.json" #17

Open guor911 opened 5 years ago

guor911 commented 5 years ago

Error message: no fixture found. I also did not find the data file to be imported in the project directory.

Finally,

  1. many of the files in the project are also python2 syntax.(eg. xrange -> rang; print -> print(); reload -> importlib.reload);
  2. import error path: image

Log:

C:\Python\Python36\python.exe E:/PycharmProjects/JMeter-Control-Center/run.py . . . . . . DEBUG:matplotlib: CACHEDIR=C:\Users\Jason.matplotlib (2019-01-14 00:51:40; init.py:415) DEBUG:matplotlib.font_manager: Using fontManager instance from C:\Users\Jason.matplotlib\fontlist-v300.json (2019-01-14 00:51:40; font_manager.py:1362) DEBUG:matplotlib.pyplot: Loaded backend TkAgg version unknown. (2019-01-14 00:51:40; pyplot.py:211) CommandError: No fixture named 'fixtures' found.

Process finished with exit code 0

v0devil commented 5 years ago

This error is happened after ./manage.py loaddata fixtures/initial_data.json ? Because fixtures is just a folder. The test data file is called data_example.csv in root directory.

guor911 commented 5 years ago

just change the data file path and file name, like below: ./ manage. py loaddata data_example.csv

I will try again.

And another thing, I sent you a email( your gmail address) and look forword to your reply.

v0devil commented 5 years ago

No it should be ./manage.py loaddata fixtures/initial_data.json Dev file is just an example to try to upload data via gui

guor911 commented 5 years ago

ok, i see. thx.

guor911 commented 5 years ago

there was an error when I upload the csv file via gui I'm not sure why the user is not present in "user" table.

log: django.db.utils.IntegrityError: insert or update on table "test" violates foreign key constraint "test_started_by_id_3df308f9_fk_user_id" DETAIL: Key (started_by_id)=(0) is not present in table "user".

image

image

image

image

v0devil commented 5 years ago

This fake user should appear from those fixtures: {"model": "administrator.user", "pk": 0, "fields": {"login": "default"}}

you can try to insert it with insert into jltc.user values (0, 'default');

In other side this I would fix in code