Forums

Model data not showing in django shell

My live app is using a MySQL database. Data is entered from the site, stored and returned. but when i run python manage.py shell and import the models, all queries return empty. as though the data entered is not stored in the database. how do i access the data from the shell?

Are you sure that your shell is connecting to the same database as your web app? Check the DATABASES setting in the shell and to make sure that it's connecting to the database that you think it's connecting to.

yes it is. as a matter of fact it just got worst i can no longer access the admin portal using my login credentials. I never had this issues on heroku and it has been frustrating. this app is on a paid plan and i cannot even contact customer care. from django.contrib.auth import settings

settings.DATABASES['default']

this shows the database. all credential correct. i even created a new user account and still it is unable to login to the admin portal and normal login interface. it is more like pythonanywhere is connecting my app to a different database from what i have in the settings module. migrations run very well each time. but i cannot access my data.

Check your error logs for your webapp. It seems like a migration issue.