Dec. 21, 2018, 3:10 a.m.

'Rastlin

Fist fought Django for 12 hours today.

Trying to set up a quick and easy way to upload all of the products to the fluidol site.

This morning I attempted to use a utility function to read an xlxs spreadsheet and automagically add them using the models. But I couldn't get the models to load. I fought and fought attempting to add the utilities folder as an app. Finally, I went in a different direction and added a management/commands folder to my core app. (my core app isn't named as such, but that seems like a much better name than the one I'm using.)

I used Django's built in ImageField when i put together the product model. It was significantly simpler to use than I thought it would be. I could copy an image url into the field and it would download it and add it to my media_root.

I was hoping it would be just as easy to use it to programmatically add the images from the xlxs spreadsheet. It wasn't. In the end I had to save the images myself into the media_root folder and then save the name in the db. It finally worked but it took a lot of reading and searching on the internet to make my way there.

Other issues I'm having. 1. I kept the settings.py out of the git. I'm running into issues where there are diffences between my installs and I'm forgetting to update them across computers. 2. The db got really weird today. The desktop is all up to date but the db on the laptop was not. When I ran make migrations/migrate it kept telling me their were no migrations needed. For the longest time I couldn't get it to even look at the fluidol_index app. I could see the migrations in the folder, but it wasn't paying attention to them. I don't think my Installed Apps was configured correctly.

After a lot of fiddling it worked, but I'm not sure why.

  1. The virtual environment has been weird as hell too. I started using Spyder to do some work. Being able to work with variables and such from the command line has been fantastic. But I'm beginning to wonder if there isn't some environment interference. That doesn't make sense to me. It seems like the command line you're operating on should be in it's own environment. But I had an instance of being able to use beautiful soup from the vscode command line without it being pip installed. It seems like it was using the environment settings from spyder/anaconda.