Pand-Aid / pandaid-api

backend for Pand-Aid pandemic response app
3 stars 3 forks source link

can't use django-admin dumpdata because of config issues #7

Closed EMCain closed 4 years ago

EMCain commented 4 years ago

steps to duplicate: run django-admin dumpdata pandaid_base in the Docker shell. It'll get an error that mentions configuration. I'm planning into looking into this more later but maybe someone else could help if they have time.

Goal is to be able to use the dumpdata and loaddata features to generate and use fixtures.

geophpherie commented 4 years ago

I think you may be able to get around this by using python manage.py dumpdata instead. I get the same error with django-adminbut using manage.py at least spits out a bunch of text and doesn't error. Can look into it more later.

bhgrant8 commented 4 years ago

appears that we may have an acceptable workaround, @jbeyer16 could you confirm?

geophpherie commented 4 years ago

I think so. From the docs here it appears that manage.py does the exact same thing as django-admin but it specifically sets the DJANGO_SETTINGS_MODULE to point to the settings. So that explains the issue. Running python manage.py pandaid_base currently returns no data, but it does execute. Running python manage.py will return what appears to be our database model. So I think we can close this issue at least.