Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty JSON responses when using local sqlite3 database #139

Open
MikeTheCanuck opened this issue Apr 23, 2017 · 1 comment
Open

Empty JSON responses when using local sqlite3 database #139

MikeTheCanuck opened this issue Apr 23, 2017 · 1 comment

Comments

@MikeTheCanuck
Copy link
Collaborator

I followed the instructions in this project's README.md and was able to migrate, importcsv and launch the application, but when I load any of the endpoints, they all respond with an empty JSON document (e.g. http://192.168.99.100:8000/budget/history/)

HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "count": 0,
    "next": null,
    "previous": null,
    "results": []
}

I have verified using DB Browser for SQLite that the expected data is in the database tables.

I have verified that after swapping the project_config.py for the one that points to AWS as the DB, I am seeing populated JSON responses [i.e. the code didn't change, just the datasource].

I can't imagine what is going wrong. Anyone have any ideas?

@hassanshamim
Copy link
Collaborator

My best guess is that youre importing the data to a different sqlite database than the one you run the application with. Are you doing this inside of a docker container?

A simple test would be to run manage.py shell and create a History object and save it. Then run the application and hit that same endpoint. If you see that object then the DB is definitely working with the application. So either the import isn't working or it is working just sending the data somewhere you don't want.

When you run the data import commands what folder are you in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants