I am trying to import data from a CSV file into an SQL database through my Django Project. I have made my models and a separate function in Pandas that extracts the specific information that I need from the CSV file itself. I am trying to use the Django Shell to load the data from the CSV file into my database models that I created in my models.py file.
However the shell can't find the CSV file when I run my function (in pandas). How do I call in or import the CSV file from my directory into the shell? Then I'll be able to use my function to extract specific data and store it in the models I created for my SQL database.
Please help. I cannot share my scripts online for good reasons however I'd just like to know how to import a CSV file into the DJango Shell from my directory, in order to manipulate it with code. I'd also love to hear how you would import specific sets of data and store it in your classes. Does my logic of using a pandas based CSV reader function to store data into my database models sound reasonable? Is there a better way to do it?
Thank you!
-Felix