JimLakis / PDM_Wildlife

0 stars 0 forks source link

Jl0806 2 #19

Closed JimLakis closed 1 year ago

JimLakis commented 1 year ago

@bbelderbos

Issue: When including optional fields in the data table model Animals found in models.py when running the PDM app in the uvicorn server the server throws exceptions that animal.animal_genus_name is not recognized?

When running a similar app when following the tutorials where the data table model is included in the same app.py file uvicorn has no issues.

  1. Can you advise?
  2. Please do not change the files associated with the project in this case nor merge them into the main as I'm not confident that I can manage that process with my current knowledge of Git and GitHub.

Thanks!

bbelderbos commented 1 year ago

@JimLakis how are you running uvicorn? For me it works (and no, did not change anything, if I would I would do it on a different branch to not interfere with anything you're doing)

  1. git pull the branch to get the latest
  2. ran uvicorn app:app
image

I see you commented the animal_genus_name line, but even uncommenting it the server still starts fine for me and I can hit the swagger docs.

JimLakis commented 1 year ago

@bbelderbos Ok. I'll try running the app again w/ and w/o those fields (example: animal.animal_genus_name) included. I was running it in uvicorn with file and module listed as app:app. Other files and packages that ran before also ran fine as a test of my uvicorn installation, etc.

Thanks for the response.

JimLakis commented 1 year ago

@bbelderbos Seems fine now... not sure what the issue was previously.

bbelderbos commented 1 year ago

OK good, happy it works.